ElAdnan / gtkdialog

Automatically exported from code.google.com/p/gtkdialog
GNU General Public License v2.0
0 stars 0 forks source link

HBox and VBox custom spacing attributes #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
HBox and VBox custom spacing attributes.

GtkHBox and GtkVBox

http://developer.gnome.org/gtk/2.24/GtkHBox.html
http://developer.gnome.org/gtk/2.24/GtkVBox.html

Gtkdialog fixes spacing to 5, but the tags accept attributes and it's trivial 
to support spacing="value".

Original issue reported on code.google.com by thunor...@hotmail.com on 22 Jun 2011 at 9:14

GoogleCodeExporter commented 8 years ago
Actually even though WIDGET_HBOX and WIDGET_VBOX are being created with a 
spacing of 5 hardcoded, their parent class GtkBox has a spacing property and so 
spacing="value" already works :)

Original comment by thunor...@hotmail.com on 23 Jun 2011 at 10:33

GoogleCodeExporter commented 8 years ago
Hmm, this then means that a WIDGET_HBOX and WIDGET_VBOX will always have a 
spacing of 5 even if GtkBox spacing="0" and the user wants the same for the 
GtkHbox and GtkVbox. 

I've just tested this by hardcoding the spacing to 0 and things close up which 
is useful, so I'll leave this open. To deal with this I'll have to make a 
custom attribute whose name doesn't conflict with anything else. Maybe I should 
investigate any other widgets with hardcoded spacing first before I come up 
with a name.

Original comment by thunor...@hotmail.com on 23 Jun 2011 at 10:59

GoogleCodeExporter commented 8 years ago
I've just noticed that hboxes (and now vboxes) in create_button are hardcoding 
spacing to 5.

Original comment by thunor...@hotmail.com on 4 Jul 2011 at 5:03

GoogleCodeExporter commented 8 years ago
The "spacing" property belongs to GtkBox and this appears to be the spacing 
property within gtk_vbox_new(gboolean homogeneous, gint spacing), so regarding 
these two widgets, there's nothing to do there.

I have just created a custom tag attribute "margin" to set the border_width 
around the hbox, vbox and window containers and I saw that the frame widget's 
border_width is being hardcoded to 5, but the frame doesn't accept tag 
attributes and can't either because it uses all of the space within the tag for 
the label!

Original comment by thunor...@hotmail.com on 24 Jul 2011 at 8:19

GoogleCodeExporter commented 8 years ago
Ah, hang on ;) automaton.c:3034 is creating a vbox with spacing 5, then setting 
its border_width to 5, then packing all of the widgets inside it and then 
placing the vbox inside the frame. Therefore the frame widget is a GtkFrame 
containing a GtkVbox. Interesting.

Original comment by thunor...@hotmail.com on 24 Jul 2011 at 10:02

GoogleCodeExporter commented 8 years ago
"margin" is now deprecated as I've fixed the "border-width" bug and that now 
works, so currently the only issue remaining here is the flawed frame widget.

Original comment by thunor...@hotmail.com on 10 Aug 2011 at 9:59

GoogleCodeExporter commented 8 years ago
I'm investigating the frame widget and writing the widget reference and I'd say 
that a new hframe and vframe should be created to deal with the frame's design 
flaws.

Original comment by thunor...@hotmail.com on 5 Sep 2011 at 4:23