Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Make Tkinter child window active

Reply
Thread Tools

Make Tkinter child window active

 
 
Svennglenn
Guest
Posts: n/a
 
      06-08-2005
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?

 
Reply With Quote
 
 
 
 
Eugene Druker
Guest
Posts: n/a
 
      06-09-2005
Try:
>
> Label(c, text="Child window").grid()

c.focus_set()
> root = Tk()


"Svennglenn" <> wrote in message
news: ups.com...
> 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?
>



 
Reply With Quote
 
 
 
 
Svennglenn
Guest
Posts: n/a
 
      06-09-2005
It's working, thank you very much

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boa: howto make child windows really child bvidinli Python 0 04-15-2008 08:58 AM
Results from child window submit into parent window, then child closes -- How To? Spammay Blockay Javascript 1 02-04-2005 12:47 PM
[HELP] Why the child window reopen a new child window ? bhchng ASP .Net 0 01-13-2004 07:17 AM
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM
Howto: Child window make parent window into focus? Randell D. Javascript 8 11-06-2003 08:51 AM



Advertisments