index
gtk-- homepage



Description:
Gtk_Box

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

Abstract base class for horizontal and vertical boxes
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:


Public member index:


static GtkType get_type();
GtkBox *gtkobj();
const GtkBox *gtkobj()const;
static bool isA(Gtk_Object *checkcast);
virtual ~Gtk_Box();
void pack_start(Gtk_Widget &child,bool expand=true,bool fill=true,guint padding=0);
pack_start inserts a widget to a box.

void pack_end(Gtk_Widget &child,bool expand=true,bool fill=true,guint padding=0);
void set_homogeneous(bool homogeneous);
void set_spacing(gint spacing);
void reorder_child(Gtk_Widget &child,gint pos);
BoxList &children();
const BoxList &children()const;
Protected member index:


void initialize_class();
void *get_parent_class();
static void init_parent_class();
explicit Gtk_Box(GtkBox *castitem);
Gtk_Box(void);
Private member index:


Gtk_Box(const Gtk_Box &);
Gtk_Box &operator =(const Gtk_Box &);

Public member details:


pack_start
void Gtk_Box::pack_start(Gtk_Widget &child,bool expand=true,bool fill=true,guint 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.)