gtk.aspect_frame

Module for [AspectFrame] class

Types 3

[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
GType _gType() @property
AspectFrame self()Returns `this`, for use in `with` statements.
AspectFrameGidBuilder builder()Get builder for [gtk.aspect_frame.AspectFrame] Returns: New builder object
gtk.widget.Widget child() @propertyGet `child` property. Returns: The child widget.
void 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].
float xalign() @propertyGet `xalign` property. Returns: The horizontal alignment of the child.
void xalign(float propval) @propertySet `xalign` property. Params: propval = The horizontal alignment of the child.
float yalign() @propertyGet `yalign` property. Returns: The vertical 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 self
bool 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 request
float getRatio()Returns the desired aspect ratio of the child. Returns: the desired aspect ratio
float getXalign()Returns the horizontal alignment of the child within the allocation of the [gtk.aspect_frame.AspectFrame]. Returns: the horizontal alignment
float getYalign()Returns the vertical alignment of the child within the allocation of the [gtk.aspect_frame.AspectFrame]. Returns: the vertical alignment
void 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].
Constructors
this(void * ptr, Flag!"Take" take)
this(float xalign, float yalign, float ratio, bool obeyChild)Create a new [gtk.aspect_frame.AspectFrame].
Methods
T child(gtk.widget.Widget propval)Set `child` property. Params: propval = The child widget. Returns: Builder instance for fluent chaining
T 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 chaining
T 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 chaining
T yalign(float propval)Set `yalign` property. Params: propval = The vertical alignment of the child. Returns: Builder instance for fluent chaining

Fluent builder for [gtk.aspect_frame.AspectFrame]