gtk.AspectFrame Style Properties

gtk.AspectFrame Signal Prototypes

Description

The gtk.AspectFrame
packs 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.AspectFrame
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.

The aspect frame "ratio" property determines the widget
width:height ratio. An aspect ratio of 0.5 means the width is one half the
height; an aspect ratio of 2.0 means the width is twice the height. The
default value for the "ratio" property is 1.0.

The align properties are used to place the child widget within the
available area by specifying the fraction of free space
(space in the aspect frame that is not used by the child widget) that is
placed above or to the left of the child widget. The values range from 0.0
(meaning no free space above or to the left of the
child) to 1.0 (meaning all free space above or to the
left of the child) . The default value for both align properties is
0.5.

If the "obey-child" property is True (the default value), the
"ratio" property is ignored and the aspect ratio is set by the child
widget.

the ratio of the child width to height (in the
range 0.0001 to 10000.0) if obey_child is
False

obey_child :

if True, ratio is ignored,
and the aspect ratio is taken from the requisition of the
child.

Returns :

a new aspect frame object

Creates a new aspect frame object with the specified
label, xalign and
yalign values. The default values are:
label, None; xalign, 0.5; and,
yalign, 0.5. If obey_child is
True the ratio value is ignored. If
obey_child is False, ratio
sets the aspect ratio for the child widget. The default value for
ratio is 1.0. The default value for
obey_child is True.

Methods

gtk.AspectFrame.set

def set(xalign=0.0, yalign=0.0, ratio=1.0, obey_child=True)

xalign :

The fraction of horizontal
free space to the left of the child. 0.0 means no
free space to the left, 1.0 means all
free space to the left.