The Gtk.Aspect_Frame.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.Gtk_Aspect_Frame derives from Gtk.Frame.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.
# CSS nodes
GtkAspectFrame uses a CSS node with name frame.
<group>Layout Containers</group> <testgtk>create_frame.adb</testgtk>
function "+"
(Widget : access Gtk_Aspect_Frame_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Aspect_Frame
function Get_Type return Glib.GType
type Gtk_Aspect_Frame is access all Gtk_Aspect_Frame_Record'Class;
function Gtk_Aspect_Frame_New
(Label : UTF8_String := "";
Xalign : Gfloat;
Yalign : Gfloat;
Ratio : Gfloat;
Obey_Child : Boolean) return Gtk_Aspect_Frame
Create a new Gtk.Aspect_Frame.Gtk_Aspect_Frame.
Label text.
Horizontal alignment of the child within the allocation of the Gtk.Aspect_Frame.Gtk_Aspect_Frame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
Vertical alignment of the child within the allocation of the Gtk.Aspect_Frame.Gtk_Aspect_Frame. This ranges from 0.0 (top aligned) to 1.0 (bottom aligned)
The desired aspect ratio.
If True, Ratio is ignored, and the aspect ratio is taken from the requistion of the child.
type Gtk_Aspect_Frame_Record is new Gtk_Frame_Record with null record;
procedure Gtk_New
(Aspect_Frame : out Gtk_Aspect_Frame;
Label : UTF8_String := "";
Xalign : Gfloat;
Yalign : Gfloat;
Ratio : Gfloat;
Obey_Child : Boolean)
Create a new Gtk.Aspect_Frame.Gtk_Aspect_Frame. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
Label text.
Horizontal alignment of the child within the allocation of the Gtk.Aspect_Frame.Gtk_Aspect_Frame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
Vertical alignment of the child within the allocation of the Gtk.Aspect_Frame.Gtk_Aspect_Frame. This ranges from 0.0 (top aligned) to 1.0 (bottom aligned)
The desired aspect ratio.
If True, Ratio is ignored, and the aspect ratio is taken from the requistion of the child.
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Aspect_Frame_Record, Gtk_Aspect_Frame);
procedure Initialize
(Aspect_Frame : not null access Gtk_Aspect_Frame_Record'Class;
Label : UTF8_String := "";
Xalign : Gfloat;
Yalign : Gfloat;
Ratio : Gfloat;
Obey_Child : Boolean)
Create a new Gtk.Aspect_Frame.Gtk_Aspect_Frame. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
Label text.
Horizontal alignment of the child within the allocation of the Gtk.Aspect_Frame.Gtk_Aspect_Frame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
Vertical alignment of the child within the allocation of the Gtk.Aspect_Frame.Gtk_Aspect_Frame. This ranges from 0.0 (top aligned) to 1.0 (bottom 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 : constant Glib.Properties.Property_Boolean;
Ratio_Property : constant Glib.Properties.Property_Float;
procedure Set
(Aspect_Frame : not null access Gtk_Aspect_Frame_Record;
Xalign : Gfloat;
Yalign : Gfloat;
Ratio : Gfloat;
Obey_Child : Boolean)
Set parameters for an existing Gtk.Aspect_Frame.Gtk_Aspect_Frame.
Horizontal alignment of the child within the allocation of the Gtk.Aspect_Frame.Gtk_Aspect_Frame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
Vertical alignment of the child within the allocation of the Gtk.Aspect_Frame.Gtk_Aspect_Frame. This ranges from 0.0 (top aligned) to 1.0 (bottom aligned)
The desired aspect ratio.
If True, Ratio is ignored, and the aspect ratio is taken from the requistion of the child.
Xalign_Property : constant Glib.Properties.Property_Float;
Yalign_Property : constant Glib.Properties.Property_Float;