Reference

Gtk_Box(3)

NAME - Gtk_Box

{lass Gtk_Box} is a base class for horizontal or vertical boxes, which layout widgets inserted to them next to each other.

HEADER REQUIRED

#include <gtk--/box.h&gt;>

BASE CLASSES

Gtk_Container(3)

DERIVED BY

Gtk_ButtonBox(3) Gtk_HBox(3) Gtk_VBox(3)

DESCRIPTION

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

children

Type: GList*

spacing

Type: gint16

homogeneous

Type: guint:1

.IP

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 &child, bool expand=true, bool fill=true, gint padding=0);
void  pack_end(const Gtk_ObjectHandle &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

friend  CppClassType;
typedef GtkBox  BaseObjectType;
typedef GtkBoxClass  BaseClassType;
virtual void * get_parent_class();
Gtk_Box();

PRIVATE MEMBER INDEX

static CppClassType  box_class;
GtkType  get_type();

PUBLIC MEMBER DESCRIPTIONS

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 (yfalse). 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.

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 DESCRIPTIONS

PRIVATE MEMBER DESCRIPTIONS