Python locks up X

sragsdale at my-deja.com sragsdale at my-deja.com
Fri Dec 17 13:38:47 EST 1999


For some reason, forking a child process and using Dialog.Dialog boxes
to call Frame.quit results in X locking up in both Irix and Linux
(Redhat 6.0).  Anyone have a clue why this is happening?  Is this sloppy
programming on my part or a bug in Tkinter?

====================================================================
#!/usr/local/bin/python

from Tkinter import *
from Dialog import Dialog
import os

def myQuit():
    ans = Dialog(window, title="Quitting...",
                 text="Hit OK to lock X.",
                 bitmap='questhead', default=0, strings=('OK','Cancel'))
    if ans.num == 0:
        window.quit()

root = Tk()
window = Frame(root)

# launch a non-terminating child process
if not os.fork():
    os.system("cat")

lbl = Button(window,text="Click to lock X",command=myQuit)

window.pack()
lbl.pack()
window.mainloop()


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list