Gtk3 replace child widget with another widget

后端 未结 4 1641
执念已碎
执念已碎 2021-01-17 10:25

I\'m looking for a way to remove a widget from its parent (whatever that may be - a VBox, a Grid, ...) and add a substitute widget in its place.

I found this answer,

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 10:38

    You can try reparent() method of Gtk.Widget. You can check docs at this link. If I remember well you should reparent child widget first, and then remove old parent widget. If it doesn't work post in comment and I'll check my docs (currently not on that machine sry).

提交回复
热议问题