[Idle-dev] Re: [Edu-sig] How to explore Tkinter interactively with IDLE 1.0

Gregor Lingl glingl at aon.at
Fri Sep 26 05:20:06 EDT 2003


Thanks Kirby, for your experiments.
On my machine things work differently and apparently
wrong. Two more very short examples.

Example 1:

Start IDLE (Python 2.3.1, IDLE 1.0)

 >>> from turtle import *
 >>> demo()

Now something very strange happens: three squares are drawn slowly and then,
after approximately two seconds the program seems to stop during execution.
Inserting appropriate print statements into turtle.py, for tracing,
reveals that the program *is* executed until the end, but this is not 
reflected
on the Canvas. (A stair and som text should have appeared.)
Trying to close the Canvas provokes the well known Windows
dialog that comes when a program doesn't react any more. There I can
terminate it immediatly by pressing the corresponding button.

The same happens on a Windows2000 Machine with Python 2.3

Of course demo can be run without problems as a separate process in IDLE 1.0
after having loaded Python23\Lib\lib-tk\turtle.py into the editor.

Conlusion: There is a bug somewhere, but I can't even loacate it exactly.


Examples 2, concerning a different sort of problem:

RestartIDLE

 >>> from Tkinter import *
 >>> root = Tk()    # Nothing happens; in IDLE 0.8 a tiny empty 
Tk-Window appeared
 >>> cv = Canvas(root)
 >>> cv.pack()      # Still nothing happens; in IDLE 0.8 you saw the 
Canvas packed intp
                   # the TK window (default-size of the Canvas)
 >>> root.mainloop()  # this was not advised in IDLE 0.8

Now the Tk-Window appears on the screen (same appearance as in IDLE 0.8)
but - of course - I cannot input any more statements into IDLE, I think
because of the running mainloop(). Only when I close the newly created 
window
IDLE is ready for more input.

Conclusion: I can't play around any more with Tkinter windows 
interactively.

Any ideas?

Gregor


Kirby Urner schrieb:

>>Hi Kirby,
>>this definitely doesn't work on my machine (Windows XP with Python 3.2)
>>    
>>
>
>I just downloaded 2.3.1 today or yesterday.  That couldn't be the difference
>could it?  Windows XP here too.
>
>It's true for me as well that when I first say up(), the Tk window is behind
>the main one.  I see it by sliding the main one out of the way.  I don't
>touch the secondary one.
>
>The secondary window (showing the turtle) is not responsive in the usual
>way.  
>
>For example, if I hit the maximize icon, nothing happens.  But next time I
>go up(), the window maximizes (i.e. the action occurs only on programmatic
>refresh).  Likewise to shrink it down again (using the icon) -- the resize
>event is postponed until the next turtle event.
>
>If the secondary window minimizes to the task bar, I double-click on it.
>Then I go up() or setx() or something, and it tends to return to its
>previous (open) state.
>
>If a window moves in front of the secondary window, and then is moved away,
>the secondary window will not refresh and is likely blank -- until the next
>turtle event.
>
>Kirby
>
>
>
>
>  
>




More information about the IDLE-dev mailing list