Class Index Cross Index Namespace Index

Class Gtk::AspectFrame

A frame that constrains its child to a particular aspect ratio.
Contained in: Gtk
Derived from: Gtk::Frame
Derived by: none

#include <gtk--/aspectframe.h>


public function member index:

AspectFrame(const string& label, gfloat xalign, gfloat yalign, gfloat ratio=1.0, bool obey_child=false);
AspectFrame(gfloat xalign, gfloat yalign, gfloat ratio=1.0, bool obey_child=false);
GtkAspectFrame* gtkobj();
const GtkAspectFrame* gtkobj() const;
static bool isA(Object* object);
void set(gfloat xalign, gfloat yalign, gfloat ratio, gint obey_child);
virtual ~AspectFrame();
 

private function member index:

void construct(const char* label, gfloat xalign, gfloat yalign, gfloat ratio, bool obey_child);
 

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.


Function Member Descriptions:

Gtk::AspectFrame::AspectFrame - Constructor with label.

AspectFrame(const string& label, gfloat xalign, gfloat yalign, gfloat ratio=1.0, bool obey_child=false);
label: Label text.

xalign: Horizontal alignment of the child within the allocation of the GtkAspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).

yalign: Vertical alignment of the child within the allocation of the GtkAspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).

ratio: The desired aspect ratio.

obey_child: If TRUE, ratio is ignored, and the aspect ratio is taken from the requistion of the child.



Gtk::AspectFrame::AspectFrame - Constructor without a label.

AspectFrame(gfloat xalign, gfloat yalign, gfloat ratio=1.0, bool obey_child=false);
The rest of the arguments are the same as above.


Gtk::AspectFrame::gtkobj - Returns the underlaying gtk+ object.

GtkAspectFrame* gtkobj();

Gtk::AspectFrame::isA - Returns true if object is this type.

static bool isA(Object* object);

Gtk::AspectFrame::set - Set parameters for the GtkAspectFrame.

void set(gfloat xalign, gfloat yalign, gfloat ratio, gint obey_child);