You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WidgetPlus::try_remove() may return true when nothing is removed. It only checks that self is one of a set number of supported widgets, and then calls the appropriate remove() function. However, there are no guarantees that the child is actually removed. Each of these APIs are a no-op when you pass a widget that's not one of their children, and it's still possible to do that with try_remove().
The text was updated successfully, but these errors were encountered:
I wonder, is there a way to fix this? Maybe with something like widget.parent() == self you could find out whether the remove will actually work. Otherwise I will update the docs to describe the behavior correctly.
widget.parent() isn't reliable, because there can be widgets between the "container" and the "child". For example, GtkHeaderBar contains multiple GtkBoxes that it puts the start, end, and center children in. widget.parent() on one of the children would return a box instead of the GtkHeaderBar.
WidgetPlus::try_remove()
may return true when nothing is removed. It only checks thatself
is one of a set number of supported widgets, and then calls the appropriateremove()
function. However, there are no guarantees that the child is actually removed. Each of these APIs are a no-op when you pass a widget that's not one of their children, and it's still possible to do that withtry_remove()
.The text was updated successfully, but these errors were encountered: