python – 删除gtk.Table中的小部件?

我在我的
python应用程序中使用gtk.Table.如何删除我附加在表中的gtk.VBox,gtk.HBox或gtk.Button等小部件?我想删除准确位置的小部件.无论如何要从表中取消附加一个子窗口小部件?

如:

table.attach(button,1,2,1,2)
table.unattach(button,1,2,1,2)

最佳答案

table.remove(button)

这通常适用于GTK容器,例如hbox和vbox,而不仅仅是表.

点赞