A frame that constrains its child to a particular aspect ratio
The <gtk-aspect-frame>
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. <gtk-aspect-frame>
derives
from <gtk-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.
Derives from
<gtk-frame>
.This class defines the following slots:
xalign
- X alignment of the child
yalign
- Y alignment of the child
ratio
- Aspect ratio if obey_child is FALSE
obey-child
- Force aspect ratio to match that of the frame's child
mchars
) (xalign float
) (yalign float
) (ratio float
) (obey_child bool
) ⇒ (ret <gtk-widget>
)Create a new
<gtk-aspect-frame>
.
- label
- Label text.
- xalign
- Horizontal alignment of the child within the allocation of the
<gtk-aspect-frame>
. This ranges from 0.0 (left aligned) to 1.0 (right aligned)- yalign
- Vertical alignment of the child within the allocation of the
<gtk-aspect-frame>
. This ranges from 0.0 (left aligned) to 1.0 (right aligned)- ratio
- The desired aspect ratio.
- obey-child
- If ‘
#t
’, ratio is ignored, and the aspect ratio is taken from the requistion of the child.- ret
- the new
<gtk-aspect-frame>
.
<gtk-aspect-frame>
) (xalign float
) (yalign float
) (ratio float
) (obey_child bool
)Set parameters for an existing
<gtk-aspect-frame>
.
- aspect-frame
- a
<gtk-aspect-frame>
- xalign
- Horizontal alignment of the child within the allocation of the
<gtk-aspect-frame>
. This ranges from 0.0 (left aligned) to 1.0 (right aligned)- yalign
- Vertical alignment of the child within the allocation of the
<gtk-aspect-frame>
. This ranges from 0.0 (left aligned) to 1.0 (right aligned)- ratio
- The desired aspect ratio.
- obey-child
- If ‘
#t
’, ratio is ignored, and the aspect ratio is taken from the requistion of the child.