gtk.aspect_frame
Module for [AspectFrame] class
Types 3
classAspectFrame : gtk.widget.Widget
[gtk.aspect_frame.AspectFrame] 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
[gtk.aspect_frame.AspectFrame] uses a CSS node with name frame.
Accessibility
Until GTK 4.10, [gtk.aspect_frame.AspectFrame] used the [gtk.types.AccessibleRole.Group] role.
Starting from GTK 4.12, [gtk.aspect_frame.AspectFrame] uses the [gtk.types.AccessibleRole.Generic] role.
Methods
AspectFrame self()Returns `this`, for use in `with` statements.AspectFrameGidBuilder builder()Get builder for [gtk.aspect_frame.AspectFrame] Returns: New builder objectvoid child(gtk.widget.Widget propval) @propertySet `child` property. Params: propval = The child widget.bool obeyChild() @propertyGet `obeyChild` property. Returns: Whether the [gtk.aspect_frame.AspectFrame] should use the aspect ratio of its child.void obeyChild(bool propval) @propertySet `obeyChild` property. Params: propval = Whether the [gtk.aspect_frame.AspectFrame] should use the aspect ratio of its child.float ratio() @propertyGet `ratio` property. Returns: The aspect ratio to be used by the [gtk.aspect_frame.AspectFrame].void ratio(float propval) @propertySet `ratio` property. Params: propval = The aspect ratio to be used by the [gtk.aspect_frame.AspectFrame].void xalign(float propval) @propertySet `xalign` property. Params: propval = The horizontal alignment of the child.void yalign(float propval) @propertySet `yalign` property. Params: propval = The vertical alignment of the child.gtk.widget.Widget getChild()Gets the child widget of self. Returns: the child widget of selfbool getObeyChild()Returns whether the child's size request should override the set aspect ratio of the [gtk.aspect_frame.AspectFrame]. Returns: whether to obey the child's size requestfloat getRatio()Returns the desired aspect ratio of the child. Returns: the desired aspect ratiofloat getXalign()Returns the horizontal alignment of the child within the allocation of the [gtk.aspect_frame.AspectFrame]. Returns: the horizontal alignmentfloat getYalign()Returns the vertical alignment of the child within the allocation of the [gtk.aspect_frame.AspectFrame]. Returns: the vertical alignmentvoid setChild(gtk.widget.Widget child = null)Sets the child widget of self.void setObeyChild(bool obeyChild)Sets whether the aspect ratio of the child's size request should override the set aspect ratio of the [gtk.aspect_frame.AspectFrame].void setRatio(float ratio)Sets the desired aspect ratio of the child.void setXalign(float xalign)Sets the horizontal alignment of the child within the allocation of the [gtk.aspect_frame.AspectFrame].void setYalign(float yalign)Sets the vertical alignment of the child within the allocation of the [gtk.aspect_frame.AspectFrame].Methods
T child(gtk.widget.Widget propval)Set `child` property. Params: propval = The child widget. Returns: Builder instance for fluent chainingT obeyChild(bool propval)Set `obeyChild` property. Params: propval = Whether the [gtk.aspect_frame.AspectFrame] should use the aspect ratio of its child. Returns: Builder instance for fluent chainingT ratio(float propval)Set `ratio` property. Params: propval = The aspect ratio to be used by the [gtk.aspect_frame.AspectFrame].T xalign(float propval)Set `xalign` property. Params: propval = The horizontal alignment of the child. Returns: Builder instance for fluent chainingT yalign(float propval)Set `yalign` property. Params: propval = The vertical alignment of the child. Returns: Builder instance for fluent chainingFluent builder for [gtk.aspect_frame.AspectFrame]
Methods