Make Tkinter child window active

S

Svennglenn

How do i make a child window "active" like the root window?

from Tkinter import *

def open_child():
c = Toplevel(root)
c.title("Child window")
c.geometry('200x160+230+130')

Label(c, text="Child window").grid()

root = Tk()
root.title("root window")

Button(root, text="Open child window", command=open_child).grid()

root.mainloop()


When the child windows opens i would like it to be active like the
root window, how can i easily do that?
 

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

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,122
Latest member
VinayKumarNevatia_
Top