IDLE 0.5 won't die (bug??)
Robert Cragie
rcc at nospamthanks_jennic.com
Fri May 5 10:26:13 EDT 2000
As IDLE is a Tkinter app. itself, you mustn't call root.mainloop(). Remove
the root.mainloop() and it should work OK.
Note that there may also be other subtle problems using IDLE with Tkinter
apps. I believe it's basically to do with event handling and which widget
the events end up at.
Robert
Jim Callahan <res031mu at gte.net> wrote in message
news:3912B392.F00D7D66 at gte.net...
| When I run the code from the Frames in TK message (code after error) as
| a script in IDLE 0.5 (using ctrl-F5) , and close the resulting window,
| IDLE won't do anything else, and I have to run a script which does a
| print "Howdy" or something of the sort to get my prompt back. IDLE the
| reports this Traceback:
|
| Hello World!
| Traceback (innermost last):
| File "C:\Program Files\Python\Tools\idle-0.5\printHi.py", line 1, in ?
|
| print "Hello World!"
| File "C:\PROGRA~1\PYTHON\TOOLS\IDLE-0.5\PyShell.py", line 637, in
| write
| self.shell.write(s, self.tags)
| File "C:\PROGRA~1\PYTHON\TOOLS\IDLE-0.5\PyShell.py", line 628, in
| write
| raise KeyboardInterrupt
| KeyboardInterrupt:
|
| ****the code that kills my IDLE**********************************
| from Tkinter import *
|
| def create_frames(master):
| # relief and borderwidth arguments make frames visible
| frame1 = Frame(master, relief='sunken', borderwidth=2)
| frame2 = Frame(master, relief='sunken', borderwidth=2)
|
| frame1.place(relx=0, rely=0, relwidth=1, relheight=0.65)
| frame2.place(relx=0, rely=0.65, relwidth=1, relheight=0.35)
|
| # put something in the frames
| label1 = Label(frame1, text="Hello")
| label1.grid(row=0, column=0)
| label2 = Label(frame2, text="World!")
| label2.grid(row=0, column=0)
|
| root = Tk()
| create_frames(root)
| root.mainloop()
|
|
|
| --
|
| Jim Callahan cobol4ever at altavista.net
|
|
More information about the Python-list
mailing list