AspectFrame

The #GtkAspectFrame is 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. #GtkAspectFrame derives from #GtkFrame, 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

GtkAspectFrame uses a CSS node with name frame.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this(string label, float xalign, float yalign, float ratio, bool obeyChild)

Create a new #GtkAspectFrame.

Members

Functions

self
AspectFrame self()

Returns this, for use in with statements.

set
void set(float xalign, float yalign, float ratio, bool obeyChild)

Set parameters for an existing #GtkAspectFrame.

Properties

_gType
GType _gType [@property getter]
obeyChild
bool obeyChild [@property getter]
obeyChild
bool obeyChild [@property setter]
ratio
float ratio [@property getter]
ratio
float ratio [@property setter]
xalign
float xalign [@property getter]
xalign
float xalign [@property setter]
yalign
float yalign [@property getter]
yalign
float yalign [@property setter]

Static functions

_getGType
GType _getGType()
builder
AspectFrameGidBuilder builder()

Get builder for gtk.aspect_frame.AspectFrame

Inherited Members

From Frame

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
Frame self()

Returns this, for use in with statements.

builder
FrameGidBuilder builder()

Get builder for gtk.frame.Frame

label
string label [@property getter]
label
string label [@property setter]
labelWidget
gtk.widget.Widget labelWidget [@property getter]
labelWidget
gtk.widget.Widget labelWidget [@property setter]
labelXalign
float labelXalign [@property getter]
labelXalign
float labelXalign [@property setter]
labelYalign
float labelYalign [@property getter]
labelYalign
float labelYalign [@property setter]
shadowType
gtk.types.ShadowType shadowType [@property getter]
shadowType
gtk.types.ShadowType shadowType [@property setter]
getLabel
string getLabel()

If the frame’s label widget is a #GtkLabel, returns the text in the label widget. (The frame will have a #GtkLabel for the label widget if a non-null argument was passed to gtk.frame.Frame.new_.)

getLabelAlign
void getLabelAlign(float xalign, float yalign)

Retrieves the X and Y alignment of the frame’s label. See gtk.frame.Frame.setLabelAlign.

getLabelWidget
gtk.widget.Widget getLabelWidget()

Retrieves the label widget for the frame. See gtk.frame.Frame.setLabelWidget.

getShadowType
gtk.types.ShadowType getShadowType()

Retrieves the shadow type of the frame. See gtk.frame.Frame.setShadowType.

setLabel
void setLabel(string label)

Removes the current #GtkFrame:label-widget. If label is not null, creates a new #GtkLabel with that text and adds it as the #GtkFrame:label-widget.

setLabelAlign
void setLabelAlign(float xalign, float yalign)

Sets the alignment of the frame widget’s label. The default values for a newly created frame are 0.0 and 0.5.

setLabelWidget
void setLabelWidget(gtk.widget.Widget labelWidget)

Sets the #GtkFrame:label-widget for the frame. This is the widget that will appear embedded in the top edge of the frame as a title.

setShadowType
void setShadowType(gtk.types.ShadowType type)

Sets the #GtkFrame:shadow-type for frame, i.e. whether it is drawn without (gtk.types.ShadowType.None) or with (other values) a visible border. Values other than gtk.types.ShadowType.None are treated identically by GtkFrame. The chosen type is applied by removing or adding the .flat class to the CSS node named border.