22

Chapter 22

TK Graphics III


Willy was a rather unusual snake, for he was fond of reading.  Snakes don’t usually care much about books, probably because they haven’t any hands to hold them with.

—Walter R. Brooks, in Freddy the Pilot

Figures

The playing field
Figure 1.
One (non) flying glyph
Figure 2.
All the (non) flying glyphs
Figure 3.
Taking names
Figure 4.
Place relative geometry management
Figure 5.
Pack geometry management
Figure 6.
Grid geometry management
Figure 7.
Grid and Pack managers together
Figure 8.

Example Programs

There are several example programs for chapter 22:  download chapter22.zip.

  1. colormap.py
  2. tkgeom.py
  3. hls2rgb.py
  4. tkm.py
  5. tkfield1.py
  6. tkfield2.py
  7. tkfield3.py
  8. tkfield4.py

Exercises

To learn more about the glyphs I’ve used here, visit days.html.  These are the glyphs for the 20 named days of the Mayan tzolk’in, a sacred calendar of 260 days.

Alchemy Mindworks can be found at http://www.mindworkshop.com/alchemy/alchemy.html.  A statement regarding the legality of their product regarding GIFs can be found at http://www.mindworkshop.com/alchemy/lzw.html.  Gif Construction Set Pro also does animated GIFs for you.

Investigate what it would take to make tkfield4.py resizeable.  Hint:  don’t forget that there are lots of rectangle objects in that Canvas widget, in addition to the glyphs.

Change the glyphs to something else that pleases you; Mah Jongg tiles, for instance. Start looking at http://www.mahjongg.com/, but the best solitaire game for your computer is Kyodai, available at http://www.kyodai.com/. You can waste incredible amounts of time with it.


Valid HTML 4.01 Transitional