Gtk.Alignment¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
d/r/w |
The padding to insert at the bottom of the widget. |
||
d/r/w |
The padding to insert at the left of the widget. |
||
d/r/w |
The padding to insert at the right of the widget. |
||
d/r/w |
The padding to insert at the top of the widget. |
||
d/r/w |
Horizontal position of child in available space. 0.0 is left aligned, 1.0 is right aligned |
||
d/r/w |
If available horizontal space is bigger than needed for the child, how much of it to use for the child. 0.0 means none, 1.0 means all |
||
d/r/w |
Vertical position of child in available space. 0.0 is top aligned, 1.0 is bottom aligned |
||
d/r/w |
If available vertical space is bigger than needed for the child, how much of it to use for the child. 0.0 means none, 1.0 means all |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
bin |
r |
Class Details¶
- class Gtk.Alignment(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Gtk.Alignment
widget controls the alignment and size of its child widget. It has four settings: xscale, yscale, xalign, and yalign.The scale settings are used to specify how much the child widget should expand to fill the space allocated to the
Gtk.Alignment
. The values can range from 0 (meaning the child doesn’t expand at all) to 1 (meaning the child expands to fill all of the available space).The align settings are used to place the child widget within the available area. The values range from 0 (top or left) to 1 (bottom or right). Of course, if the scale settings are both set to 1, the alignment settings have no effect.
Gtk.Alignment
has been deprecated in 3.14 and should not be used in newly-written code. The desired effect can be achieved by using theGtk.Widget
:halign
,Gtk.Widget
:valign
andGtk.Widget
:margin
properties on the child widget.- classmethod new(xalign, yalign, xscale, yscale)[source]¶
- Parameters:
xalign (
float
) – the horizontal alignment of the child widget, from 0 (left) to 1 (right).yalign (
float
) – the vertical alignment of the child widget, from 0 (top) to 1 (bottom).xscale (
float
) – the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for theGtk.Alignment
.yscale (
float
) – the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xscale.
- Returns:
the new
Gtk.Alignment
- Return type:
Creates a new
Gtk.Alignment
.Deprecated since version 3.14: Use
Gtk.Widget
alignment and margin properties
- get_padding()[source]¶
- Returns:
- padding_top:
location to store the padding for the top of the widget, or
None
- padding_bottom:
location to store the padding for the bottom of the widget, or
None
- padding_left:
location to store the padding for the left of the widget, or
None
- padding_right:
location to store the padding for the right of the widget, or
None
- Return type:
(padding_top:
int
, padding_bottom:int
, padding_left:int
, padding_right:int
)
Gets the padding on the different sides of the widget. See
Gtk.Alignment.set_padding
().New in version 2.4.
Deprecated since version 3.14: Use
Gtk.Widget
alignment and margin properties
- set(xalign, yalign, xscale, yscale)[source]¶
- Parameters:
xalign (
float
) – the horizontal alignment of the child widget, from 0 (left) to 1 (right).yalign (
float
) – the vertical alignment of the child widget, from 0 (top) to 1 (bottom).xscale (
float
) – the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for theGtk.Alignment
.yscale (
float
) – the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xscale.
Sets the
Gtk.Alignment
values.Deprecated since version 3.14: Use
Gtk.Widget
alignment and margin properties
- set_padding(padding_top, padding_bottom, padding_left, padding_right)[source]¶
- Parameters:
Sets the padding on the different sides of the widget. The padding adds blank space to the sides of the widget. For instance, this can be used to indent the child widget towards the right by adding padding on the left.
New in version 2.4.
Deprecated since version 3.14: Use
Gtk.Widget
alignment and margin properties
Property Details¶
- Gtk.Alignment.props.bottom_padding¶
- Name:
bottom-padding
- Type:
- Default Value:
0
- Flags:
The padding to insert at the bottom of the widget.
New in version 2.4.
Deprecated since version 3.14: Use
Gtk.Widget.set_margin_bottom
() instead
- Gtk.Alignment.props.left_padding¶
- Name:
left-padding
- Type:
- Default Value:
0
- Flags:
The padding to insert at the left of the widget.
New in version 2.4.
Deprecated since version 3.14: Use
Gtk.Widget.set_margin_start
() instead
- Gtk.Alignment.props.right_padding¶
- Name:
right-padding
- Type:
- Default Value:
0
- Flags:
The padding to insert at the right of the widget.
New in version 2.4.
Deprecated since version 3.14: Use
Gtk.Widget.set_margin_end
() instead
- Gtk.Alignment.props.top_padding¶
- Name:
top-padding
- Type:
- Default Value:
0
- Flags:
The padding to insert at the top of the widget.
New in version 2.4.
Deprecated since version 3.14: Use
Gtk.Widget.set_margin_top
() instead
- Gtk.Alignment.props.xalign¶
- Name:
xalign
- Type:
- Default Value:
0.5
- Flags:
Horizontal position of child in available space. A value of 0.0 will flush the child left (or right, in RTL locales); a value of 1.0 will flush the child right (or left, in RTL locales).
Deprecated since version 3.14: Use
Gtk.Widget.set_halign
() on the child instead
- Gtk.Alignment.props.xscale¶
- Name:
xscale
- Type:
- Default Value:
1.0
- Flags:
If available horizontal space is bigger than needed, how much of it to use for the child. A value of 0.0 means none; a value of 1.0 means all.
Deprecated since version 3.14: Use
Gtk.Widget.set_hexpand
() on the child instead
- Gtk.Alignment.props.yalign¶
- Name:
yalign
- Type:
- Default Value:
0.5
- Flags:
Vertical position of child in available space. A value of 0.0 will flush the child to the top; a value of 1.0 will flush the child to the bottom.
Deprecated since version 3.14: Use
Gtk.Widget.set_valign
() on the child instead
- Gtk.Alignment.props.yscale¶
- Name:
yscale
- Type:
- Default Value:
1.0
- Flags:
If available vertical space is bigger than needed, how much of it to use for the child. A value of 0.0 means none; a value of 1.0 means all.
Deprecated since version 3.14: Use
Gtk.Widget.set_vexpand
() on the child instead