FAQ
Hi,

I'm running Python2.3.3c1 on Mandrake 9.1

The following code is designed to bring up a window with a button labeled
"popup". Clicking on the popup buttons triggers a secondary window with a
button labeled "ok". The second window is supposed to be modal - it should
not be possible to reset the focus back to the first window or close the
first window without first closing the second. The program works just fine
in Windows XP home, but in Linux I can close the first window while the
second one is still active.

This seems to be a bug, or am I doing something wrong. I searched google
for Tkinter Linux modal, but found nothing relevant.

Thanks for your help.

Here's the code, copied and pasted from IDLE.

#############################
from Tkinter import *

makemodal = 1

def dialog():
win = Toplevel()
Label(win, text = "Secondary").pack()
Button(win, text = "Ok", command = win.destroy).pack()
if makemodal:
win.focus_set()
win.grab_set()
win.wait_window()
print "dialog exit"

root = Tk()
Button(root, text = 'popup', command = dialog).pack()
root.mainloop()
#################################

Mike
mmoum-xxxspam.woh.rr.com
--
Remove -xxxspam to reply

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedJan 15, '04 at 12:13a
activeJan 16, '04 at 11:46p
posts4
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase