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 706269 - Clarify GtkBox, GtkHBox, and GtkVBox documentation
Clarify GtkBox, GtkHBox, and GtkVBox documentation
Product: gtk+
Classification: Platform
Component: .General
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
: 707715 (view as bug list)
Depends on:
Reported: 2013-08-18 20:48 UTC by Conscious User
Modified: 2013-09-17 02:39 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Conscious User 2013-08-18 20:48:09 UTC
The GTK documentation encourages developers to use GtkGrid for all boxing needs, replacing GtkVBox, GtkHBox, GtkBox, GtkTable, etc. In fact, the GtkHBox documentation even says:

"If you want your code to be future-proof, the recommendation is to switch to GtkGrid, since GtkBox is going to be deprecated in favor of the more flexible grid widget eventually."

However, peeking at some core GNOME apps like Nautilus, I noticed that linked buttons are being implemented with GtkBox. I tried implementing one with GtkGrid, but it had some visual issues which I reported as a bug in the Adwaita component:

Paolo Borelli then pointed out that a bidimensional grid does not have well-defined concepts of "first child" and "last child", which makes sense. So I'm stuck now. I see some options from here:

- Bring the whole concept of linked buttons into its own widget and style that instead.
- Establish that GtkBox is not going to be deprecated after all.
- Introduce a new GtkGrid property that restricts it to being one-dimensional.

Comment 1 Matthias Clasen 2013-08-19 02:25:25 UTC
There's nothing wrong with GtkBox. Feel free to use it
Comment 2 Conscious User 2013-08-19 02:33:05 UTC
Thanks, Matthias. Then I suppose the GtkHBox and GtkVBox docs should be slightly changed, since they explicitly recommend GtkGrid to be future-proof.
Comment 3 Emmanuele Bassi (:ebassi) 2013-09-08 12:15:56 UTC
*** Bug 707715 has been marked as a duplicate of this bug. ***
Comment 4 Emmanuele Bassi (:ebassi) 2013-09-08 12:16:09 UTC
GtkHBox and GtkVBox should just recommend GtkBox as their replacement.

would you care to prepare a patch? I'd be happy to review it.
Comment 5 Sébastien Wilmet 2013-09-08 12:31:31 UTC
The section "Migrating from other containers to GtkGrid" should be adapted too. The title is misleading, and the first sentence is:

> GtkGrid is an attempt to write a comprehensive, legacy-free, box-layout
> container that is flexible enough to replace GtkBox, GtkTable and the like.