Gtk.AspectFrame¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.AspectFrame(**kwargs)¶
- Bases:
- Abstract:
No
GtkAspectFrame
preserves the aspect ratio of its child.The frame can respect the aspect ratio of the child widget, or use its own aspect ratio.
- CSS nodes
GtkAspectFrame
uses a CSS node with nameframe
.- Accessibility
Until GTK 4.10,
GtkAspectFrame
used theGTK_ACCESSIBLE_ROLE_GROUP
role.Starting from GTK 4.12,
GtkAspectFrame
uses theGTK_ACCESSIBLE_ROLE_GENERIC
role.- classmethod new(xalign, yalign, ratio, obey_child)[source]¶
- Parameters:
xalign (
float
) – Horizontal alignment of the child within the parent. Ranges from 0.0 (left aligned) to 1.0 (right aligned)yalign (
float
) – Vertical alignment of the child within the parent. Ranges from 0.0 (top aligned) to 1.0 (bottom aligned)ratio (
float
) – The desired aspect ratio.obey_child (
bool
) – IfTrue
, ratio is ignored, and the aspect ratio is taken from the requistion of the child.
- Returns:
the new
GtkAspectFrame
.- Return type:
Create a new
GtkAspectFrame
.
- get_child()[source]¶
- Returns:
the child widget of self
- Return type:
Gtk.Widget
orNone
Gets the child widget of self.
- get_obey_child()[source]¶
- Returns:
whether to obey the child’s size request
- Return type:
Returns whether the child’s size request should override the set aspect ratio of the
GtkAspectFrame
.
- get_ratio()[source]¶
- Returns:
the desired aspect ratio
- Return type:
Returns the desired aspect ratio of the child.
- get_xalign()[source]¶
- Returns:
the horizontal alignment
- Return type:
Returns the horizontal alignment of the child within the allocation of the
GtkAspectFrame
.
- get_yalign()[source]¶
- Returns:
the vertical alignment
- Return type:
Returns the vertical alignment of the child within the allocation of the
GtkAspectFrame
.
- set_child(child)[source]¶
- Parameters:
child (
Gtk.Widget
orNone
) – the child widget
Sets the child widget of self.
- set_obey_child(obey_child)[source]¶
- Parameters:
obey_child (
bool
) – IfTrue
, ratio is ignored, and the aspect ratio is taken from the requisition of the child.
Sets whether the aspect ratio of the child’s size request should override the set aspect ratio of the
GtkAspectFrame
.
- set_ratio(ratio)[source]¶
- Parameters:
ratio (
float
) – aspect ratio of the child
Sets the desired aspect ratio of the child.
Property Details¶
- Gtk.AspectFrame.props.child¶
- Name:
child
- Type:
- Default Value:
- Flags:
The child widget.
- Gtk.AspectFrame.props.obey_child¶
- Name:
obey-child
- Type:
- Default Value:
- Flags:
Whether the
GtkAspectFrame
should use the aspect ratio of its child.
- Gtk.AspectFrame.props.ratio¶
- Name:
ratio
- Type:
- Default Value:
1.0
- Flags:
The aspect ratio to be used by the
GtkAspectFrame
.This property is only used if [property`Gtk`.AspectFrame:obey-child] is set to
False
.
- Gtk.AspectFrame.props.xalign¶
- Name:
xalign
- Type:
- Default Value:
0.5
- Flags:
The horizontal alignment of the child.
- Gtk.AspectFrame.props.yalign¶
- Name:
yalign
- Type:
- Default Value:
0.5
- Flags:
The vertical alignment of the child.