Alignment widget allows you to place
a widget within its window at a position and size relative to the size of
Alignment widget itself. For example, it can be
very useful for centering a widget within the window.
There are only two calls associated with the
alignment = gtk.Alignment(
gtk.Alignment() function creates a new
Alignment widget with the specified parameters. The
set() method allows the alignment parameters of an
Alignment widget to be altered.
All four alignment parameters are floating point numbers which
can range from 0.0 to 1.0. The
yalign arguments affect the position of the widget
placed within the
widget. The align properties specify the fraction of
free space that will be placed above or to the left of
the child widget. The values range from 0.0 (no free
space above or to the left of the child) to 1.0 (all
free space above or to the left of the child). Of
course, if the scale properties are both set to 1.0, the alignment
properties have no effect since the child widget will expand to fill the
yscale arguments specify the fraction of
free space absorbed by the child widget. The values can
range from 0.0 (meaning the child absorbs none) to 1.0 (meaning the child
absorbs all of the free space).
A child widget can be added to this
Alignment widget using:
For an example of using an
widget, refer to the progressbar.py
example for the Progress Bar widget.