Gtk.Aspect_Frame

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

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
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Aspect_Frame
Parameters
Interf
Return Value

Get_Type

function Get_Type return Glib.GType
Return Value

Gtk_Aspect_Frame

type Gtk_Aspect_Frame is access all Gtk_Aspect_Frame_Record'Class;

Gtk_Aspect_Frame_New

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.

Parameters
Label

Label text.

Xalign

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)

Yalign

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)

Ratio

The desired aspect ratio.

Obey_Child

If True, Ratio is ignored, and the aspect ratio is taken from the requistion of the child.

Return Value

Gtk_Aspect_Frame_Record

type Gtk_Aspect_Frame_Record is new Gtk_Frame_Record with null record;

Gtk_New

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.

Parameters
Aspect_Frame
Label

Label text.

Xalign

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)

Yalign

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)

Ratio

The desired aspect ratio.

Obey_Child

If True, Ratio is ignored, and the aspect ratio is taken from the requistion of the child.

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Aspect_Frame_Record, Gtk_Aspect_Frame);

Initialize

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.

Parameters
Aspect_Frame
Label

Label text.

Xalign

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)

Yalign

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)

Ratio

The desired aspect ratio.

Obey_Child

If True, Ratio is ignored, and the aspect ratio is taken from the requistion of the child.

Obey_Child_Property

Obey_Child_Property : constant Glib.Properties.Property_Boolean;

Ratio_Property

Ratio_Property : constant Glib.Properties.Property_Float;

Set

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.

Parameters
Aspect_Frame
Xalign

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)

Yalign

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)

Ratio

The desired aspect ratio.

Obey_Child

If True, Ratio is ignored, and the aspect ratio is taken from the requistion of the child.

Xalign_Property

Xalign_Property : constant Glib.Properties.Property_Float;

Yalign_Property

Yalign_Property : constant Glib.Properties.Property_Float;