[Contents] [Back] [Prev] [Up] [Next] [Forward]

# Package Gtk.Aspect`_`Frame

A Gtk_Aspect_Frame is the same type of widget as a frame, but it constrains its child to a specific aspect ratio between its width and its height.

This ratio can either be given explicitly by the user, or chosen from the widget's initial size request (might be different from the one if was actually given).

- Gtk.Aspect_Frame Widget Hierarchy
- Gtk.Aspect_Frame Subprograms

## Widget Hierarchy

    GObject                       (see section Package Glib.Object)
    Gtk_Object                    (see section Package Gtk.Object)
       \___ Gtk_Widget            (see section Package Gtk.Widget)
          \___ Gtk_Container      (see section Package Gtk.Container)
             \___ Gtk_Bin         (see section Package Gtk.Bin)
                \___ Gtk_Frame    (see section Package Gtk.Frame)
                   \___ Gtk_Aspect_Frame (see section Package Gtk.Aspect_Frame)

## Subprograms

    procedure Gtk_New
      (Aspect_Frame       : out    Gtk_Aspect_Frame;
       Label              :        UTF8_String;
       Xalign             :        Gfloat;
       Yalign             :        Gfloat;
       Ratio              :        Gfloat;
       Obey_Child         :        Boolean);

Create a new Aspect_Frame.
If Label is the empty string, then the frame won't have any title. Xalign and Yalign are constrained to the range 0.0 .. 1.0 and specify the alignment of the child inside the frame (0.0 means either left or top aligned, 1.0 means right or bottom aligned). Ratio is the ratio width/height for the child of the frame. If Obey_Child is True, then Ratio is ignored and the effective ratio is taken from the child's requisition (ie the ideal size it asked for at creation time).

    function Get_Type              return Gtk.Gtk_Type;

| Return the internal value associated with a Gtk_Aspect_Frame.

    procedure Set
      (Aspect_Frame       : access Gtk_Aspect_Frame_Record;
       Xalign             :        Gfloat;
       Yalign             :        Gfloat;
       Ratio              :        Gfloat;
       Obey_Child         :        Boolean);

| Modify the frame's parameters (see the description of these parameters for Gtk_New.

    function Get_Ratio
      (Aspect_Frame       : access Gtk_Aspect_Frame_Record)
       return Gfloat;

| Return the current ratio for the frame (width / height)

    function Get_Xalign
      (Aspect_Frame       : access Gtk_Aspect_Frame_Record)
       return Gfloat;

| Return the current X alignment for the frame. 0.0 means the child is left aligned, 1.0 that it is right aligned.

    function Get_Yalign
      (Aspect_Frame       : access Gtk_Aspect_Frame_Record)
       return Gfloat;

| Return the current Y alignment for the frame. 1.0 means the child is top aligned, 1.0 that it is bottom aligned.

[Contents] [Back] [Prev] [Up] [Next] [Forward]