[Tutor] Motion

alan.gauld@bt.com alan.gauld@bt.com
Sun Dec 22 18:11:02 2002


> Well, ah...
> this is what you'd do on a 1984 C64.
> 
> POKE 1024+Y*40+X,MAN
> 
> OR call the kernal plot routine
> 
> SYS Plot, y,x,0: PRINT MAN;
> 

Yes, But the C64 knew exactly what kind of terminal it was 
controlling. Python doesn't have a clue (well actually on 
unix it has a clue via the TERM variable - but only a clue...)

> Only thing is, here we go with novelletes that read to me like..."
> Isn't there a serious problem hidden in here: what happens 
> when the __init__ function returns and the frame variable 
> goes out of scope?
> 
> Just relax; there's actually no need to keep a reference to 
> the widget instance.
> "

Tkiner is not trivial it is true, but its easier than trying to 
control an unknown interface with no standard API...

> "example is adapted from the "hello world" program in Matt Conway's A
> Tkinter Life Preserver ."

Conway was good in its day but its now seriously out of date, 
better to use Fred Lundhs tutor and the New Mexico site posted 
recently.

For your purpose you only need a simple frame containing a 
canvas widget. Then use the canvas methods to draw pretty 
much like the C64 plot functions.


Check out the tkinter section on the python web site for 
links to Lundh...

In fact the GUI intro on my tutor might suffice for your needs!

Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld