Makeing TopLevel Modal ?

P

Pete Moscatt

Hi all,

I want to make a dialog (using Tk Toplevel) but need it to be modal. Is
this possible using Tk ?

Show below is an example how I am calling the custom dialog:

class main:
def __init__(self,parent):

top = self.top = Toplevel(parent)
top.title("Server Settings")
top.minsize(width=230,height=270)
top.maxsize(width=230,height=270)





Pete
 
S

stewart.midwinter

well, top.transient(root) will ensure your toplevel window is on top of
all others.
IIRC, you could also use top.grab_set() to make it modal, but you'll
have to try it and see.

S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top