index
gtk-- homepage



Description:
Gtk_Box

#include <gtk--/box.h>
Base classes: Gtk_Container
Derived by: Gtk_ButtonBox Gtk_HBox Gtk_VBox

{\class Gtk_Box} is a base class for horizontal or vertical boxes, which layout widgets inserted to them next to each other.
Gtk_Box is an abstract class and it defers choice of which way the widgets are packed to the screen to the derived classes. Gtk_Box provides common interface for inserting widgets to a box indepenently of how it is shown in the screen.

The most common use of Gtk_Box is like this:

class mywindow : public Gtk_Window { Gtk_Label label1,label2; Gtk_VBox vbox; public: mywindow(); }; mywindow::mywindow() { add(vbox); vbox.pack_end(label1, true, true, 0); vbox.pack_end(label2, true, true, 0); }



Properties:

NameTypeGetSetDescription
children GList*      
spacing gint16      
homogeneous guint:1    



Public member index:


Gtk_Box(GtkBox *castitem);
void pack_start(const Gtk_Widget &child,bool expand=true,bool fill=true,gint padding=0);
pack_start inserts a widget to a box.

void pack_end(const Gtk_Widget &child,bool expand=true,bool fill=true,gint padding=0);
void pack_start(const Gtk_ObjectHandle <Gtk_Widget > &child,bool expand=true,bool fill=true,gint padding=0);
void pack_end(const Gtk_ObjectHandle <Gtk_Widget > &child,bool expand=true,bool fill=true,gint padding=0);
void set_homogeneous(bool homogeneous);
void set_spacing(gint spacing);
void reorder_child(const Gtk_Widget &child,gint pos);
void query_child_packing(const Gtk_Widget &child,bool *expand,bool *fill,guint *padding,GtkPackType *pack_type)const;
void set_child_packing(const Gtk_Widget &child,bool expand,bool fill,guint padding,GtkPackType pack_type);
GtkBox *gtkobj();
const GtkBox *gtkobj()const;
static bool isGtkBox(Gtk_Object *checkcast);
Protected member index:


virtual void *get_parent_class();
Gtk_Box();
Private member index:


GtkType get_type();

Public member details:


pack_start
void Gtk_Box::pack_start(const Gtk_Widget &child,bool expand=true,bool fill=true,gint padding=0);

pack_start inserts a widget to a box.
The expand argument to pack_start() or pack_end() controls whether the widgets are laid out in the box to fill in all the extra space in the box so the box is expanded to fill the area alloted to it (true). Or the box is shrunk to just fit the widgets (false). Setting expand to false will allow you to do right and left justifying of your widgets. Otherwise, they will all expand to fit in the box, and the same effect could be achieved by using only one of pack_start() or pack_end() functions.

The fill argument to the pack_start()/pack_end() functions control whether the extra space is allocated to the objects themselves (true), or as extra padding in the box around these objects (\keyfalse). It only has an effect if the expand argument is also true.

What's the difference between spacing (set when the box is created) and padding (set when elements are packed)? Spacing is added between objects, and padding is added on either side of an object.


set_homogeneous
void Gtk_Box::set_homogeneous(bool homogeneous);

allows setting homongeneous afterwards. This is usually given on Gtk_VBox::Gtk_VBox() or Gtk_HBox::Gtk_HBox()


Protected member details:



Private member details:



Examples:





(pages generated by PERCEPS -script.)