vbbox
vbbox is derived from abstract class 'bbox'. vbbox gives
a layout of buttons in a vertical order; spacing is  given using
the 'layout-style' property.

All the API functions needed to work with hbbox are found in
bbox, and box types.

Creating a hbbox is simple, using the function 

		bbox=gtk_hbutton_box_new();
		gtk_button_box_set_layout(GTK_BBOX(bbox),GTK_BUTTONBOX_START);
		gtk_button_box_set_secondary(GTK_BBOX(bbox),wid[i],TRUE);

Advanced usage can try 'g_object_new' approach with something like this

		bbox=g_object_new(GTK_TYPE_VBUTTON_BOX,
				  "layout-style",GTK_BUTTONBOX_END,
				NULL);

which is easier, when youre familiar with GTK+. You may also use the
bbox API to work on the hbuttonbox objects.
				  

Example
{		GtkWidget *wid[10];
		bbox=gtk_vbutton_box_new();
		/* add some items */
		for(i=0;i<10;i++) {
		wid[i]=gtk_label_new(g_strdup_printf("%d",i));
		gtk_box_pack_start(GTK_BOX(bbox),
			wid[i],FALSE,FLASE,0);
		}
				
		/* change layout */
		gtk_button_box_set_layout(GTK_BBOX(bbox),GTK_BUTTONBOX_START);

		/* set some widgets as secondary */
		for(i=0;i<5;i++){
		gtk_button_box_set_secondary(GTK_BBOX(bbox),wid[i],TRUE);
		}

		/* show widgets */
		gtk_widget_show_all(bbox);
	
}		
see also: bbox, box




Last Modified on Fri Jul 1 20:12:56 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