简体   繁体   中英

PyGtk: How to unpack boxes

I'm looking for a way to unpack boxes again.

So having eg a construct like that:

# ... 
vbox = gtk.VBox()
hbox = gtk.HBox()
vbox.pack_start(hbox,False, False, 0)

label = gtk.Label("Please insert text:")
entry = gtk.Entry()

hbox.pack_start(label,False, False, 0)
hbox.pack_end(entry,False, False, 0)

vbox.show_all()
# ... 

I'm wondering how I could remove the hbox out of the vbox.

Each box is also a gtk.Container. Therefore there a method() which is removing the widget from container. So

vbox.remove(self.hbox)

did the trick.

(Only resizing of my dialog is pending ;) )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM