After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 97731 - Widget parents should be containers.
Widget parents should be containers.
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.4
Other other
: Normal enhancement
: 3
Assigned To: gtkmm-forge
gtkmm-forge
Depends on: 98402
Blocks:
 
 
Reported: 2002-11-05 14:07 UTC by Matthew Tuck
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Matthew Tuck 2002-11-05 14:07:27 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.
Comment 1 Murray Cumming 2002-11-06 10:26:31 UTC
Maybe you could submit an equivalent bug for GTK+.

If necessary, we will fix this at the next API break.
Comment 2 Murray Cumming 2002-11-09 17:33:26 UTC
Have you submitted a GTK+ bug?
Comment 3 Murray Cumming 2002-11-13 16:21:19 UTC
Added the GTK+ bug myself.
Comment 4 Murray Cumming 2002-11-13 17:02:17 UTC
I'd like someone to provide a patch to be applied at the next API break.