GNOME Bugzilla – Bug 97731
Widget parents should be containers.
Last modified: 2004-12-22 21:47:04 UTC
You would expect a widget parent to be a Container, yet the APIs have them as ordinary Widgets. This leads to excessive casting. void reparent(Widget & newparent); Widget* get_parent(); const Widget* get_parent() const; void on_parent_changed(Widget* previous_parent); Glib::SignalProxy1<void,Widget*> signal_parent_changed(); void set_parent(Widget& parent); Perhaps oddly, property_parent() is a Container. Obviously other than the get_parent calls, this change would break API compatibility, but only for broken programs anyway. Perhaps also get_parent should have covariant returns - I would expect MenuItem::get_parent() to return a MenuShell for example.
Maybe you could submit an equivalent bug for GTK+. If necessary, we will fix this at the next API break.
Have you submitted a GTK+ bug?
Added the GTK+ bug myself.
I'd like someone to provide a patch to be applied at the next API break.