[Tutor] Tkinter not my friend any more

Rob rob@uselesspython.com
Sun, 14 Jul 2002 17:41:47 -0500


Since you like the Java way of doing this sort of thing, how about the use
of Jython/Swing or something similar?

Rob
http://uselesspython.com

-----Original Message-----
From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
dominic.fox
Sent: Sunday, July 14, 2002 5:36 PM
To: tutor@python.org
Subject: [Tutor] Tkinter not my friend any more


Hi all,

I'm having trouble getting Tkinter to do what I want it to do, and I think
the reason is that Tkinter just isn't designed to do that thing. Basically I
want an image buffer in a window on the screen that I can read and write to,
plotting graphics primitives or even altering its contents pixel-by-pixel.
I'd like to do something along the lines of the standard
double-buffering/animation tutorial that I've seen in more than one Java
book. However, an assumption of Tkinter is that any bitmaps you want are
going to be in a file somewhere - there doesn't seem to be a way to create a
"blank" one and then do things to its contents. PIL will let you do that,
but you have to convert the PIL Image object to an ImageTk bitmap image or
photo image which is then not dynamically rewriteable...

I'm aware that Tkinter has it's own quite groovy way of letting you draw
graphics primitives into a window, where you add to a collection of objects
which Tkinter itself takes responsibility for rendering and refreshing, but
that's no use if what you actually want to do is plot Mandelbrot sets (for
instance). Ideally I'd prefer to do things the Java way, by having a canvas
object which supplies a graphics context for use by various rendering
objects and raises events when parts of it need to be refreshed - it's more
low-level, but more powerful for just that reason. Can this absolutely not
be done in Tkinter? Can it be done at all in, say, wxWindows?

Dominic



_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor