GNOME Bugzilla – Bug 706269
Clarify GtkBox, GtkHBox, and GtkVBox documentation
Last modified: 2013-09-17 02:39:38 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: https://bugzilla.gnome.org/show_bug.cgi?id=705687 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. Opinions?
There's nothing wrong with GtkBox. Feel free to use it
Thanks, Matthias. Then I suppose the GtkHBox and GtkVBox docs should be slightly changed, since they explicitly recommend GtkGrid to be future-proof.
*** Bug 707715 has been marked as a duplicate of this bug. ***
GtkHBox and GtkVBox should just recommend GtkBox as their replacement. would you care to prepare a patch? I'd be happy to review it.
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.