GTK+ 2 Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <gtk/gtk.h> struct GtkAspectFrame; GtkWidget * gtk_aspect_frame_new (const gchar *label
,gfloat xalign
,gfloat yalign
,gfloat ratio
,gboolean obey_child
); void gtk_aspect_frame_set (GtkAspectFrame *aspect_frame
,gfloat xalign
,gfloat yalign
,gfloat ratio
,gboolean obey_child
);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkFrame +----GtkAspectFrame
"obey-child" gboolean : Read / Write "ratio" gfloat : Read / Write "xalign" gfloat : Read / Write "yalign" gfloat : Read / Write
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.
GtkWidget * gtk_aspect_frame_new (const gchar *label
,gfloat xalign
,gfloat yalign
,gfloat ratio
,gboolean obey_child
);
Create a new GtkAspectFrame.
|
Label text. |
|
Horizontal alignment of the child within the allocation of the GtkAspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned) |
|
Vertical alignment of the child within the allocation of the GtkAspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned) |
|
The desired aspect ratio. |
|
If TRUE , ratio is ignored, and the aspect
ratio is taken from the requistion of the child. |
Returns : |
the new GtkAspectFrame. |
void gtk_aspect_frame_set (GtkAspectFrame *aspect_frame
,gfloat xalign
,gfloat yalign
,gfloat ratio
,gboolean obey_child
);
Set parameters for an existing GtkAspectFrame.
|
a GtkAspectFrame |
|
Horizontal alignment of the child within the allocation of the GtkAspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned) |
|
Vertical alignment of the child within the allocation of the GtkAspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned) |
|
The desired aspect ratio. |
|
If TRUE , ratio is ignored, and the aspect
ratio is taken from the requistion of the child. |
"obey-child"
property "obey-child" gboolean : Read / Write
Force aspect ratio to match that of the frame's child.
Default value: TRUE
"ratio"
property "ratio" gfloat : Read / Write
Aspect ratio if obey_child is FALSE.
Allowed values: [0.0001,10000]
Default value: 1
"xalign"
property "xalign" gfloat : Read / Write
X alignment of the child.
Allowed values: [0,1]
Default value: 0.5