Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you change a widget's parent in python tkinter?

Is there any way to change a widget's (ttk.frame in this case) parent? I can't find any keywords to use in the widgets .config. Is this not possible in python tkinter? What I'd like functionally is to take my current frame in my tkk.notebook widget, and when I double click the tab, to have everything in the frame of the tab, move to it's own separate TopLevel window. This way the user can have a visual reference to that tab while working on another tab. I couldn't think of any other way to have this happen without the frame functionality I'm asking about. Perhaps if anyone can circumvent this issue, I won't need to worry about parent widget capabilities.

Cheers, Chris

like image 715
Ponml Avatar asked Jun 08 '11 21:06

Ponml


People also ask

What is parent in tkinter?

parent represents a widget to act as the parent of the current object. All widgets in tkinter except the root window require a parent (sometimes also called a master) controller represents some other object that is designed to act as a common point of interaction for several pages of widgets.

How do you Ungrid in tkinter?

Step 1: First, import the library tkinter. Step 2: Now, create a GUI app using tkinter. Step 3: Then, create a function to remove widgets from the grid in tkinter. In the function created, we have used the inbuilt function grid_remove() to remove certain widgets.

What is Textvariable in tkinter?

textvariable is used to provide value through a variable. value can be Integer or String. for integer : IntVar() keyword is used. for String: StringVar() keyword is used.

What is Relheight in tkinter?

relheight, relwidth − Height and width as a float between 0.0 and 1.0, as a fraction of the height and width of the parent widget. relx, rely − Horizontal and vertical offset as a float between 0.0 and 1.0, as a fraction of the height and width of the parent widget. x, y − Horizontal and vertical offset in pixels.


1 Answers

An old post by Fredrik Lundh (the Tkinter author) suggests that it isn't possible to change a widget's parent.

like image 162
tzot Avatar answered Oct 18 '22 21:10

tzot