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 613132 - GtkBoxChild should probably be deprecated
GtkBoxChild should probably be deprecated
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
2.21.x
Other All
: Urgent minor
: ---
Assigned To: gtk-bugs
gtk-bugs
deprecations
Depends on:
Blocks:
 
 
Reported: 2010-03-17 10:38 UTC by Murray Cumming
Modified: 2011-02-04 16:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Deprecate GtkBoxChild (1016 bytes, patch)
2010-03-28 02:16 UTC, Christian Dywan
none Details | Review
Deprecate GtkBoxChild (687 bytes, patch)
2010-05-10 10:09 UTC, Christian Dywan
committed Details | Review

Description Murray Cumming 2010-03-17 10:38:51 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.
Comment 1 Matthias Clasen 2010-03-17 12:30:44 UTC
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.
Comment 2 Emmanuele Bassi (:ebassi) 2010-03-17 18:07:31 UTC
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
Comment 3 Murray Cumming 2010-03-19 08:43:14 UTC
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*.)
Comment 4 Christian Dywan 2010-03-28 02:16:58 UTC
Created attachment 157299 [details] [review]
Deprecate GtkBoxChild
Comment 5 Javier Jardón (IRC: jjardon) 2010-04-28 01:21:06 UTC
Should the functions gtk_box_query_child_packing () and gtk_box_set_child_packing () be deprecated too?
Comment 6 Christian Dywan 2010-05-10 10:09:08 UTC
Created attachment 160702 [details] [review]
Deprecate GtkBoxChild

Updated patch against master
Comment 7 Javier Jardón (IRC: jjardon) 2010-05-11 00:38:23 UTC
(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
Comment 8 Matthias Clasen 2010-05-12 00:13:11 UTC
To answer the question in comment 5: no
The patch looks fine
Comment 9 Javier Jardón (IRC: jjardon) 2010-05-22 04:41:04 UTC
For GtkNoteBokkPage see bug #618327