Gtk.AspectFrame¶
- Subclasses:
 None
Methods¶
- Inherited:
 Gtk.Frame (9), 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  | 
|---|---|---|---|
r/w/en  | 
Force aspect ratio to match that of the frame’s child  | 
||
r/w/en  | 
Aspect ratio if obey_child is   | 
||
r/w/en  | 
X alignment of the child  | 
||
r/w/en  | 
Y alignment of the child  | 
Style Properties¶
- Inherited:
 
Signals¶
- Inherited:
 
Fields¶
- Inherited:
 
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
frame  | 
r  | 
Class Details¶
- class Gtk.AspectFrame(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
The
Gtk.AspectFrameis useful when you want pack a widget so that it can resize but always retains the same aspect ratio. For instance, one might be drawing a small preview of a larger image.Gtk.AspectFramederives fromGtk.Frame, so it can draw a label and a frame around the child. The frame will be “shrink-wrapped” to the size of the child.- CSS nodes
 
Gtk.AspectFrameuses a CSS node with name frame.- classmethod new(label, xalign, yalign, ratio, obey_child)[source]¶
 - Parameters:
 xalign (
float) – Horizontal alignment of the child within the allocation of theGtk.AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)yalign (
float) – Vertical alignment of the child within the allocation of theGtk.AspectFrame. This 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
Gtk.AspectFrame.- Return type:
 
Create a new
Gtk.AspectFrame.
- set(xalign, yalign, ratio, obey_child)[source]¶
 - Parameters:
 xalign (
float) – Horizontal alignment of the child within the allocation of theGtk.AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)yalign (
float) – Vertical alignment of the child within the allocation of theGtk.AspectFrame. This 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.
Set parameters for an existing
Gtk.AspectFrame.
Property Details¶
- Gtk.AspectFrame.props.obey_child¶
 - Name:
 obey-child- Type:
 - Default Value:
 - Flags:
 
Force aspect ratio to match that of the frame’s child
- Gtk.AspectFrame.props.ratio¶
 - Name:
 ratio- Type:
 - Default Value:
 1.0- Flags:
 
Aspect ratio if obey_child is
False
- Gtk.AspectFrame.props.xalign¶
 - Name:
 xalign- Type:
 - Default Value:
 0.5- Flags:
 
X alignment of the child
- Gtk.AspectFrame.props.yalign¶
 - Name:
 yalign- Type:
 - Default Value:
 0.5- Flags:
 
Y alignment of the child