Class Index Cross Index Namespace Index

Class Gtk::Alignment

A widget which controls the alignment and size of its child.
Contained in: Gtk
Derived from: Gtk::Bin
Derived by: none

#include <gtk--/alignment.h>


public function member index:

explicit Alignment(gfloat xalign=0.5, gfloat yalign=0.5, gfloat xscale=1.0, gfloat yscale=1.0);
gfloat get_xalign() const;
gfloat get_xscale() const;
gfloat get_yalign() const;
gfloat get_yscale() const;
GtkAlignment* gtkobj();
const GtkAlignment* gtkobj() const;
static bool isA(Object* object);
void set(gfloat xalign=0.5, gfloat yalign=0.5, gfloat xscale=1.0, gfloat yscale=1.0);
virtual ~Alignment();
 

Description:

Normally, a widget is allocated at least as much size as it requests. When a widget is allocated more size than it requests there is a question of how the widget should expand. By convention, most GTK widgets expand to fill their allocated space. Sometimes this behavior is not desired. The alignment widget allows the programmer to specify how a widget should expand and position itself to fill the area it is allocated.


Function Member Descriptions:

Gtk::Alignment::gtkobj - Returns the underlaying gtk+ object.

GtkAlignment* gtkobj();

Gtk::Alignment::isA - Returns true if object is this type.

static bool isA(Object* object);

Gtk::Alignment::set - Sets the properties for this widget.

void set(gfloat xalign=0.5, gfloat yalign=0.5, gfloat xscale=1.0, gfloat yscale=1.0);
Sets both the alignment and scale of the widget packed into it.

xalign, yalign: Valid range is [0, 1]. These variables specify how to position the child widget when it is not allocated all the space available to it. A value of 0.0 positions the widget to the left or top of its allocated space. A value of 1.0 positions the widget to the right or bottom of its allocated space. Specifying 0.5 will center the widget in its allocated space.

xscale, yscale: Valid range is [0, 1]. Use these parameters to specify how to scale the child widget. If the scale value is 0.0, the child widget is allocated exactly the size it requested in that dimension. If the scale value is 1.0, the child widget is allocated all of the space in a dimension. A scale value of 1.0 for both x and y is equivalent to not using an alignment widget.