GNOME Bugzilla – Bug 553573
Add orientation API to GtkBox
Last modified: 2010-07-10 03:49:26 UTC
See bug #541009. Here are the patches for GtkBox, GtkHBox and GtkVBox.
Created attachment 119295 [details] [review] Patch implementing the above Add orientation API to GtkBox, move all of GtkHBox' and GtkVBox' code to GtkBox. Unrelated: move the newly added "spacing_set" boolean to GtkBoxPrivate Will do deprecations in separate commits because they imply lots of related changes.
+ "homogeneous", homogeneous ? TRUE : FALSE, + private->spacing_set = spacing_set ? TRUE : FALSE; Why ? These are already booleans... - guint GSEAL (spacing_set) : 1; Why remove this field from the public struct ? You'll have to add the new functions to gtk.symbols and gtk-sections.txt. Other than this, looks fine to me. Would be great to add some example of box flipping to gtk-demo.
> + private->spacing_set = spacing_set ? TRUE : FALSE; > > Why ? > These are already booleans... To make sure that only TRUE and FALSE ends up in the member, especially since there is only one bit available (call it paranoia). > - guint GSEAL (spacing_set) : 1; > > Why remove this field from the public struct ? Because it's newly added in unstable and should go into the private struct now that one is available. > Would be great to add some example of box flipping to gtk-demo. I have some flipping test code that I will commit with all affected flippable widgets one the whole bunch of patches is in.
Interestingly, some bugzilla archeology turned out an old duplicate
*** Bug 304099 has been marked as a duplicate of this bug. ***
Created attachment 119764 [details] [review] Implement GtkOrientable instead of having an own orientation API
Looks good to me.
Committed. Leaving the bug open since deprecation needs to be discussed. 2008-10-07 Michael Natterer <mitch@imendio.com> Bug 553573 – Add orientation API to GtkBox * gtk/gtkbox.[hh]: implement the GtkOrientable interface and swallow all code from GtkHBox and GtkVBox. Add gtk_box_new() which takes a GtkOrientation argument. Also move the newly added "spacing_set" boolean from struct GtkBox to the new private struct. * gtk/gtkhbox.[ch] * gtk/gtkvbox.[ch]: remove all code except the constructor and call gtk_orientable_set_orientation() in init(). * gtk/gtk.symbols: add gtk_box_new().
We also need to discuss changing the new instantiatable widget's defaults (like defaulting to visible instead of invisible) before this bug can be closed.
Closing since we gave up on visible