From: Kevin A. <al...@se...> - 2001-10-13 03:05:37
|
I'm in the process of converting the turtle sample to use the BitmapCanvas widget. I haven't checked the changes into cvs yet, but I expect to have the conversion done sometime this weekend. The reason I'm posting this message now rather than when I'm done is in case some people on the list are using the existing turtle sample and want to get their input in while I'm working on this. The big change is that there will be a new turtle module that contains an AbstractTurtle and BitmapTurtle class. The aTurtle.py and wxTurtle.py modules in the turtle sample directory will be removed. The BitmapTurtle uses a BitmapCanvas widget rather than directly drawing on a wxPython device context (DC). The drawing time is slower than before, but all the drawing is buffered, so the bitmap is no longer lost if the turtle window is obscured or minimized. In addition, Auto Refresh can be turned off to get a dramatic speed improvement, you just won't see the drawing until it is completed. You can still have any number of turtles you want, so the turtle is a good way of doing artificial life experiments. If you want to get fancy you can have multiple BitmapCanvas widgets in a window and multiple turtles per BitmapCanvas. The turtle(s) can still be driven from the shell. Once the change is complete I can start looking at expanding the coordinate system, so each turtle can have its own units of measurement, scale, etc. The end result should be a system that is very flexible and powerful. I will have to fix a few of the existing scripts to work with the new setup and this also gives me some incentive to get back to the BitmapCanvas widget and wrap up the wxPython wxPen and wxBrush, etc. I kept the AbstractTurtle class so that in the future we can still have a PostScriptTurtle or other varieties. ka |