gtk.Misc
gtk.Misc — a base class for widgets with alignments and
padding.
Description
The gtk.Misc widget is an
abstract widget used to derive subclasses which have alignment and padding
attributes. The horizontal and vertical padding attributes allow extra space
to be added around the widget. The horizontal and vertical alignment
attributes enable the widget to be positioned within its allocated area. The
alignment values represent the fraction of available free space (allocation
minus the widget size) to place to the left or above the widget for x and y
alignment respectively. Note that if the widget is added to a container in
such a way that it expands automatically to fill its allocated area, the
alignment settings will have no effect.
Methods
gtk.Misc.set_alignment
def set_alignment(xalign, yalign)
|
xalign : | the horizontal alignment |
yalign : | the vertical alignment |
The set_alignment() method sets the
alignment of the widget in its allocated space. xalign
sets the fraction (0.0-1.0) of free space (horizontal allocation minus
widget width) to place to the left of the widget.
yalign sets the fraction (0.0-1.0) of free space
(vertical allocation minus widget height) to place above the widget.
gtk.Misc.get_alignment
Returns : | a tuple containing the X and Y alignments of the
widget |
The get_alignment() method returns a
tuple containing the X and Y alignments of the widget within its allocation.
See set_alignment().
gtk.Misc.set_padding
def set_padding(xpad, ypad)
|
xpad : | the amount of space to add on the left and
right of the widget, in pixels. |
ypad : | the amount of space to add on the top and
bottom of the widget, in pixels. |
The set_padding() method sets the
amount of space to add around the widget. The xpad
value specifies the number of pixels of padding to add to the left and right
of the widget. The yalign value specifies the number
of pixels to add above and below the widget.
gtk.Misc.get_padding
Returns : | a tuple containing the horizontal and vertical
padding in pixels for the widget. |
The get_padding() method returns a
tuple containing the padding in the horizontal and vertical directions of
the widget. See set_padding().