Beginning Tkinter problem

John Purser NO_SPAM_jmpurser2 at attbi.com
Fri Apr 5 17:56:07 EST 2002


Okay, I think I got it.  I didn't notice the example wasn't typed in at an
interactive prompt, it was run from a script.  Still I'd like to know what
step to skip so I can run them from the interactive prompt.  Watching a GUI
interface get built up one line at a time from code is very cool!

And again answering my own question with dubious authority it appears that
if you leave the widget.mainloop() out it works fine.  Possibly because IDLE
is a Tkinter application itself and is already running a mainloop() and my
little app inherited it?  Now I'm really guessing so somebody clue me in!

Thanks,

John Purser

"John Purser" <NO_SPAM_jmpurser2 at attbi.com> wrote in message
news:7Hpr8.233293$q2.21629 at sccrnsc01...
> When working in IDLE(2.2) on Win2000 and attempting some Hello world class
> programs I get stuck after entering this code:
> >>> from Tkinter import Label
> >>> widget = Label(None, text='Hello GUI World!')
> >>> widget.pack()
> >>> widget.mainloop()
>
> The little window pops up, I click on the x in the corner and the window
> disappears.  But I never get my IDLE interactive prompt back.  Even going
> into the task manager and killing it there takes a while.
>
> So what am I doing wrong?
>
> Thanks,
>
> John Purser
>
>





More information about the Python-list mailing list