GNOME Bugzilla – Bug 613132
GtkBoxChild should probably be deprecated
Last modified: 2011-02-04 16:12:18 UTC
GtkBox::children is now GSEAL()ed, meaning that it's semi-deprecated. That is a list of GtkBoxChild*. GtkBoxChild is not used in any other part of the API, but it is not yet deprecated: http://library.gnome.org/devel/gtk/unstable/GtkBox.html#GtkBoxChild It probably should be. Note that we use GtkBox::children in gtkmm to provide an STL-style iterator-based interface to the child widgets. We'll probably have to remove that API in gtkmm 3, which we are not particularly happy about.
Oh, well. GtkBoxChild was certainly never good for anything, so it should probably be deprecated. But not before 2.20 is out. No more deprecations this cycle. We could certainly consider adding some child iter to GtkContainer, if you think that is valuable.
something we did in Clutter that might be interesting for gtk+ 3.0: instead of using a boxed type to store container-child properties we have a generic ChildMeta abstract type that a container implementation might create when a child is added to it. this allows introspection to work and it's generic enough to provide hooks for sub-classes and language bindings. the ChildMeta is also responsible for storing the child properties, instead of using an ad hoc GParamSpecPool. relevant files for the API: http://git.clutter-project.org/cgit.cgi?url=clutter/tree/clutter/clutter-container.h http://git.clutter-project.org/cgit.cgi?url=clutter/tree/clutter/clutter-container.h
Likewise, GtkNotebook page should also be deprecated: http://library.gnome.org/devel/gtk/unstable/GtkNotebook.html#GtkNotebookPage It's passed as a parameter of the switch-page signal but I don't see how anybody could be using it: http://library.gnome.org/devel/gtk/unstable/GtkNotebook.html#GtkNotebook-switch-page Notes to self about gtkmm after looking at all our uses of children struct fields: - Our Container class has get_children(), using gtk_container_get_children(), returning a read-only STL-style list. That might be enough. It just doesn't let us do erase() and then get an iter to the next item while looping. - We seem to provide an iter-based API for GtkNotebook without using a child struct, though it does use GtkNotebook::children - For MenuShell, we use GtMenuShell::children (now GSEAL()ed), which is a list of GtkMenuItem, which is real public API used (via GtkWidget* parameters) in GtkMenuShell. - We use GtkTableChild with GtkTable::children, but that's not even documented, so probably doesn't need to be deprecated: (The GtkTable documentation says that children is a list of widgets, incorrectly implying that it's a list of GtkWidget*.)
Created attachment 157299 [details] [review] Deprecate GtkBoxChild
Should the functions gtk_box_query_child_packing () and gtk_box_set_child_packing () be deprecated too?
Created attachment 160702 [details] [review] Deprecate GtkBoxChild Updated patch against master
(In reply to comment #3) > Likewise, GtkNotebook page should also be deprecated: > http://library.gnome.org/devel/gtk/unstable/GtkNotebook.html#GtkNotebookPage > It's passed as a parameter of the switch-page signal but I don't see how > anybody could be using it: > > http://library.gnome.org/devel/gtk/unstable/GtkNotebook.html#GtkNotebook-switch-page Filled Bug #618327
To answer the question in comment 5: no The patch looks fine
For GtkNoteBokkPage see bug #618327