buttonbox is an abstract  type, so you may not instantiate
it; however you can create a bbox using the derived types,
hbbox and vbbox types. hbbox is horizontal bbox, while vbbox
is a vertical bbox.

This bbox API is used to work on the derived types hbbox, and 
vbbox, which contain a button box.

Button boxes can have layouts defined by
/* Button box styles */
typedef enum 
} GtkButtonBoxStyle;

in both hbbox, vbbox.  This is store/set in the "layout-style",

The layout-style property says how to layout the buttons in the box.
 Possible values are default, spread, edge, start and end.
Values are set from  GTK_TYPE_BUTTON_BOX_STYLE enum.

Accessor functions:
GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox      *widget);
void              gtk_button_box_set_layout (GtkButtonBox      *widget,
					     GtkButtonBoxStyle  layout_style);

An interesting thing about bbox is you can set some child
widget to be of secondary types; this means, these widggets
will be grouped separately, from the rest of child widget,
even though in a same box.

The "secondary" property puts a button in a new group. It is a 
boolean property, if set TRUE, the child appears in a secondary group 
of children, suitable for, e.g., help buttons

Accessor functions are: 

gboolean    gtk_button_box_get_child_secondary (GtkButtonBox      *widget,
		  			         GtkWidget         *child);s
  Returns whether a child should appear in a secondary group of children.

void       gtk_button_box_set_child_secondary (GtkButtonBox      *widget,
					      GtkWidget         *child,
					      gboolean           is_secondary);

 if is_secondary: if TRUE, the child appears in a secondary group of the
 button box.

  Sets whether @child should appear in a secondary group of children.
  A typical use of a secondary child is the help button in a dialog.

  This group appears after the other children if the style
  GTK_BUTTONBOX_EDGE, and before the other children if the style
  is GTK_BUTTONBOX_END. For horizontal button boxes, the definition
  of before/after depends on direction of the widget (see
  gtk_widget_set_direction()). If the style is GTK_BUTTONBOX_START
  or GTK_BUTTONBOX_END, then the secondary children are aligned at
  the other end of the button box from the main children. For the
  other styles, they appear immediately next to the main children.

Also remember GTK+ libraries are all based on GObject, and have Object Oriented
interfaces to prorgammers. So if a function is not in here, you can
you the parent 'box' types function, even if not there, its parent type
ad-nauseum. Hence avoid using deprecated functions in your program, when
exploring the type system will give results.

{		GtkWidget *wid[10];
		/* add some items */
		for(i=0;i<10;i++) {
		/* change layout */

		/* set some widgets as secondary */

		/* show widgets */

see: hbbox, vbbox, box

Last Modified on Fri Jul 1 19:51:43 IST 2005
This is part of the GtkBook project Hosted Here
This code, documents and images are © Muthiah Annamalai
This document is under Creative Commons License given by LICENSE