GtkAspectFrame
GtkAspectFrame — A frame that constrains its child to a particular aspect ratio
|
|
Implemented Interfaces
GtkAspectFrame implements
AtkImplementorIface and GtkBuildable.
Includes
#include <gtk/gtk.h>
Description
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.
Types and Values
struct GtkAspectFrame
struct GtkAspectFrame;
struct GtkAspectFrameClass
struct GtkAspectFrameClass {
GtkFrameClass parent_class;
};
Property Details
The “obey-child” property
“obey-child” gboolean
Force aspect ratio to match that of the frame's child.
Owner: GtkAspectFrame
Flags: Read / Write
Default value: TRUE
The “ratio” property
“ratio” gfloat
Aspect ratio if obey_child is FALSE.
Owner: GtkAspectFrame
Flags: Read / Write
Allowed values: [0.0001,10000]
Default value: 1
The “xalign” property
“xalign” gfloat
X alignment of the child.
Owner: GtkAspectFrame
Flags: Read / Write
Allowed values: [0,1]
Default value: 0.5
The “yalign” property
“yalign” gfloat
Y alignment of the child.
Owner: GtkAspectFrame
Flags: Read / Write
Allowed values: [0,1]
Default value: 0.5