Class Index | Cross Index | Namespace Index |
Abstract base class for horizontal and vertical boxes
Contained in: Gtk
Derived from:
Gtk::Container
Derived by:
Gtk::ButtonBox
Gtk::HBox
Gtk::VBox
#include <gtk--/box.h>
public function member index: |
||
BoxList& | children | (); |
const BoxList& | children | () const; |
GtkBox* | gtkobj | (); |
const GtkBox* | gtkobj | () const; |
static bool | isA | (Object* object); |
void | pack_end | (Gtk::Widget& child, bool expand=true, bool fill=true, guint padding=0); |
void | pack_start | (Gtk::Widget& child, bool expand=true, bool fill=true, guint padding=0); |
void | reorder_child | (Gtk::Widget& child, gint pos); |
void | set_homogeneous | (bool homogeneous); |
void | set_spacing | (gint spacing); |
virtual | ~Box | (); |
protected function member index: |
||
Box | (); | |
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); }
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 (false). It only has an effect if the expand argument is also true.
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.
allows setting homongeneous afterwards. This is usually given on VBox or HBox