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 _getGType() static nothrow
GType _gType() @property nothrow
AspectFrame self() nothrowReturns `this`, for use in `with` statements.
AspectFrameGidBuilder builder() static nothrowGet builder for [gtk.aspect_frame.AspectFrame] Returns: New builder object
gtk.widget.Widget child() @property nothrowGet `child` property. Returns: The child widget.
void child(gtk.widget.Widget propval) @property nothrowSet `child` property. Params: propval = The child widget.
bool obeyChild() @property nothrowGet `obeyChild` property. Returns: Whether the [gtk.aspect_frame.AspectFrame] should use the aspect ratio of its child.
void obeyChild(bool propval) @property nothrowSet `obeyChild` property. Params: propval = Whether the [gtk.aspect_frame.AspectFrame] should use the aspect ratio of its child.
float ratio() @property nothrowGet `ratio` property. Returns: The aspect ratio to be used by the [gtk.aspect_frame.AspectFrame].
void ratio(float propval) @property nothrowSet `ratio` property. Params: propval = The aspect ratio to be used by the [gtk.aspect_frame.AspectFrame].
float xalign() @property nothrowGet `xalign` property. Returns: The horizontal alignment of the child.
void xalign(float propval) @property nothrowSet `xalign` property. Params: propval = The horizontal alignment of the child.
float yalign() @property nothrowGet `yalign` property. Returns: The vertical alignment of the child.
void yalign(float propval) @property nothrowSet `yalign` property. Params: propval = The vertical alignment of the child.
gtk.widget.Widget getChild() nothrowGets the child widget of self. Returns: the child widget of self
bool getObeyChild() nothrowReturns 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() nothrowReturns the desired aspect ratio of the child. Returns: the desired aspect ratio
float getXalign() nothrowReturns the horizontal alignment of the child within the allocation of the [gtk.aspect_frame.AspectFrame]. Returns: the horizontal alignment
float getYalign() nothrowReturns 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) nothrowSets the child widget of self.
void setObeyChild(bool obeyChild) nothrowSets 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) nothrowSets the desired aspect ratio of the child.
void setXalign(float xalign) nothrowSets the horizontal alignment of the child within the allocation of the [gtk.aspect_frame.AspectFrame].
void setYalign(float yalign) nothrowSets 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].

Fluent builder implementation template for gtk.aspect_frame.AspectFrame

Methods
T child(gtk.widget.Widget propval) nothrowSet `child` property. Params: propval = The child widget. Returns: Builder instance for fluent chaining
T obeyChild(bool propval) nothrowSet `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) nothrowSet `ratio` property. Params: propval = The aspect ratio to be used by the [gtk.aspect_frame.AspectFrame].
T xalign(float propval) nothrowSet `xalign` property. Params: propval = The horizontal alignment of the child. Returns: Builder instance for fluent chaining
T yalign(float propval) nothrowSet `yalign` property. Params: propval = The vertical alignment of the child. Returns: Builder instance for fluent chaining

Fluent builder for gtk.aspect_frame.AspectFrame

Methods
AspectFrame build() nothrowCreate object from builder. Returns: New object