Ruby/Tk Goldverg demo (called by 'widget')
Based on Tcl/Tk8.5a2 widget demos.
The following is the original comment of TkGoldberg.tcl.
>>##+################################################################# >># >># TkGoldberg.tcl >># by Keith Vetter, March 13, 2003 >># >># “Man will always find a difficult means to perform a simple task” >># Rube Goldberg >># >># Reproduced here with permission. >># >>##+################################################################# >># >># Keith Vetter 2003-03-21: this started out as a simple little program >># but was so much fun that it grew and grew. So I apologize about the >># size but I just couldn't resist sharing it. >># >># This is a whizzlet that does a Rube Goldberg type animation, the >># design of which comes from an New Years e-card from IncrediMail. >># That version had nice sound effects which I eschewed. On the other >># hand, that version was in black and white (actually dark blue and >># light blue) and this one is fully colorized. >># >># One thing I learned from this project is that drawing filled complex >># objects on a canvas is really hard. More often than not I had to >># draw each item twice–once with the desired fill color but no >># outline, and once with no fill but with the outline. Another trick >># is erasing by drawing with the background color. Having a flood fill >># command would have been extremely helpful. >># >># Two wiki pages were extremely helpful: Drawing rounded rectangles >># which I generalized into Drawing rounded polygons, and regular >># polygons which allowed me to convert ovals and arcs into polygons >># which could then be rotated (see Canvas Rotation). I also wrote >># Named Colors to aid in the color selection. >># >># I could comment on the code, but it's just 26 state machines with >># lots of canvas create and move calls.
- MODULE Tk
- CLASS TkGoldberg_Demo