Search code examples
pythonpygtk

pygtk: cannot set parent on toplevel widget


I'm working on a project that has a glade GUI.

I need the main window to have 2 section, divided by a gtk.Hpaned widget (horizontal panes).

The left pane would have a tool-bar like layout of buttons, maybe 3 or more.

What I need is a way to create different windows and display them on the right pane of the main window. This way, when I click button 1, subwindow1 will appear in the right pane. Click button2, subwindow2 will appear on the right pane.

Instead of having windows pop-up left and right, I want to reparent them to the right pane of this gtk.Hpaned widged.

How do you do this in python with pygtk?


Solution

  • Do you try this?

    gtk.Widget.reparent(new_parent)
    

    The reparent() method moves a widget from one gtk.Container to another.