## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Container

- Goto spec source

# Description

    package Gtk.Container is

Base class for widgets that have children.

When writing your own container widgets, you need to fully handle the size_allocate event, by also resizing all the children (based on their size requisition). The size_allocate event will always be sent to the parent when a child calls Gtk.Widget.Queue_Resize.

Binding from C File version 2.8.17

# Packages

### For_Pkg (generic)

<doc_ignore>
Full description

# Classes

### Gtk_Container_Record

- Goto declaration in source
- Goto full declaration in source

    type Gtk_Container_Record is new Gtk.Widget.Gtk_Widget_Record with private;

#### Ancestors:

Gtk.Widget.Gtk_Widget_Record
Glib.Object.GObject_Record

#### Immediate Children:

Gtk.Bin.Gtk_Bin_Record
Gtk.Box.Gtk_Box_Record
Gtk.Clist.Gtk_Clist_Record
Gtk.Extra.Sheet.Gtk_Sheet_Record
Gtk.Fixed.Gtk_Fixed_Record
Gtk.Icon_View.Gtk_Icon_View_Record
Gtk.Layout.Gtk_Layout_Record
Gtk.List.Gtk_List_Record
Gtk.Menu_Shell.Gtk_Menu_Shell_Record
Gtk.Notebook.Gtk_Notebook_Record
Gtk.Paned.Gtk_Paned_Record
Gtk.Socket.Gtk_Socket_Record
Gtk.Table.Gtk_Table_Record
Gtk.Text_View.Gtk_Text_View_Record
Gtk.Toolbar.Gtk_Toolbar_Record
Gtk.Tree_View.Gtk_Tree_View_Record

#### Primitive operations:

Add

- To API doc
- To spec

Check_Resize

- To API doc
- To spec

Child_Get_Property

- To API doc
- To spec

Child_Set_Property

- To API doc
- To spec

Child_Type

- To API doc
- To spec

Forall

- To API doc
- To spec

Foreach

- To API doc
- To spec

Get_Border_Width

- To API doc
- To spec

Get_Children

- To API doc
- To spec

Get_Focus_Chain

- To API doc
- To spec

Get_Focus_Child

- To API doc
- To spec

Get_Focus_Hadjustment

- To API doc
- To spec

Get_Focus_Vadjustment

- To API doc
- To spec

Get_Resize_Mode

- To API doc
- To spec

Glib.Object.Deallocate

- To API doc
- To spec

(Inherited)
Glib.Object.Get_Type

- To API doc
- To spec

(Inherited)
Glib.Object.Notify

- To API doc
- To spec

(Inherited)
Glib.Object.Ref

- To API doc
- To spec

(Inherited)
Glib.Object.Ref_Sink

- To API doc
- To spec

(Inherited)
Glib.Object.Unref

- To API doc
- To spec

(Inherited)
Gtk.Widget.Activate

- To API doc
- To spec

(Inherited)
Gtk.Widget.Add_Accelerator

- To API doc
- To spec

(Inherited)
Gtk.Widget.Add_Events

- To API doc
- To spec

(Inherited)
Gtk.Widget.Add_Mnemonic_Label

- To API doc
- To spec

(Inherited)
Gtk.Widget.Can_Activate_Accel

- To API doc
- To spec

(Inherited)
Gtk.Widget.Child_Notify

- To API doc
- To spec

(Inherited)
Gtk.Widget.Class_Path

- To API doc
- To spec

(Inherited)
Gtk.Widget.Class_Path_Reversed

- To API doc
- To spec

(Inherited)
Gtk.Widget.Create_Pango_Context

- To API doc
- To spec

(Inherited)
Gtk.Widget.Create_Pango_Layout

- To API doc
- To spec

(Inherited)
Gtk.Widget.Destroy

- To API doc
- To spec

(Inherited)
Gtk.Widget.Draw

- To API doc
- To spec

(Inherited)
Gtk.Widget.Ensure_Style

- To API doc
- To spec

(Inherited)
Gtk.Widget.Error_Bell

- To API doc
- To spec

(Inherited)
Gtk.Widget.Flag_Is_Set

- To API doc
- To spec

(Inherited)
Gtk.Widget.Flags

- To API doc
- To spec

(Inherited)
Gtk.Widget.Freeze_Child_Notify

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Allocation_Height

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Allocation_Width

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Allocation_X

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Allocation_Y

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Ancestor

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Child_Requisition

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Child_Visible

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Colormap

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Composite_Name

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Direction

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Events

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Extension_Events

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Has_Tooltip

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Name

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_No_Show_All

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Pango_Context

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Parent

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Parent_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Pointer

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Root_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Size_Request

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Snapshot

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_State

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Style

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Tooltip_Markup

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Tooltip_Text

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Tooltip_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Toplevel

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Visual

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Grab_Default

- To API doc
- To spec

(Inherited)
Gtk.Widget.Grab_Focus

- To API doc
- To spec

(Inherited)
Gtk.Widget.Has_Screen

- To API doc
- To spec

(Inherited)
Gtk.Widget.Hide

- To API doc
- To spec

(Inherited)
Gtk.Widget.Hide_All

- To API doc
- To spec

(Inherited)
Gtk.Widget.Input_Shape_Combine_Mask

- To API doc
- To spec

(Inherited)
Gtk.Widget.Intersect

- To API doc
- To spec

(Inherited)
Gtk.Widget.Is_Ancestor

- To API doc
- To spec

(Inherited)
Gtk.Widget.Is_Composited

- To API doc
- To spec

(Inherited)
Gtk.Widget.Is_Focus

- To API doc
- To spec

(Inherited)
Gtk.Widget.Keynav_Failed

- To API doc
- To spec

(Inherited)
Gtk.Widget.List_Mnemonic_Labels

- To API doc
- To spec

(Inherited)
Gtk.Widget.Map

- To API doc
- To spec

(Inherited)
Gtk.Widget.Mnemonic_Activate

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Base

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Bg

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Cursor

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Fg

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Font

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Text

- To API doc
- To spec

(Inherited)
Gtk.Widget.Path

- To API doc
- To spec

(Inherited)
Gtk.Widget.Path_Reversed

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Clear

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Clear_Area

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Draw

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Draw_Area

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Resize

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Resize_No_Redraw

- To API doc
- To spec

(Inherited)
Gtk.Widget.Realize

- To API doc
- To spec

(Inherited)
Gtk.Widget.Region_Intersect

- To API doc
- To spec

(Inherited)
Gtk.Widget.Remove_Accelerator

- To API doc
- To spec

(Inherited)
Gtk.Widget.Remove_Mnemonic_Label

- To API doc
- To spec

(Inherited)
Gtk.Widget.Render_Icon

- To API doc
- To spec

(Inherited)
Gtk.Widget.Reparent

- To API doc
- To spec

(Inherited)
Gtk.Widget.Reset_Rc_Styles

- To API doc
- To spec

(Inherited)
Gtk.Widget.Reset_Shapes

- To API doc
- To spec

(Inherited)
Gtk.Widget.Restore_Default_Style

- To API doc
- To spec

(Inherited)
Gtk.Widget.Send_Expose

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Accel_Path

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_App_Paintable

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Child_Visible

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Colormap

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Composite_Name

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Direction

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Double_Buffered

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Events

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Extension_Events

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Flags

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Has_Tooltip

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Name

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_No_Show_All

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Parent

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Parent_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Redraw_On_Allocate

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Scroll_Adjustments

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Sensitive

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Size_Request

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_State

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Style

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Tooltip_Markup

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Tooltip_Text

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Tooltip_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_UPosition

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_USize

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Shape_Combine_Mask

- To API doc
- To spec

(Inherited)
Gtk.Widget.Show

- To API doc
- To spec

(Inherited)
Gtk.Widget.Show_All

- To API doc
- To spec

(Inherited)
Gtk.Widget.Show_Now

- To API doc
- To spec

(Inherited)
Gtk.Widget.Size_Allocate

- To API doc
- To spec

(Inherited)
Gtk.Widget.Size_Request

- To API doc
- To spec

(Inherited)
Gtk.Widget.Style_Get_Property

- To API doc
- To spec

(Inherited)
Gtk.Widget.Thaw_Child_Notify

- To API doc
- To spec

(Inherited)
Gtk.Widget.Trigger_Tooltip_Query

- To API doc
- To spec

(Inherited)
Gtk.Widget.Unmap

- To API doc
- To spec

(Inherited)
Gtk.Widget.Unrealize

- To API doc
- To spec

(Inherited)
Gtk.Widget.Unset_Flags

- To API doc
- To spec

(Inherited)
Propagate_Expose

- To API doc
- To spec

Remove

- To API doc
- To spec

Resize_Children

- To API doc
- To spec

Set_Border_Width

- To API doc
- To spec

Set_Focus_Chain

- To API doc
- To spec

Set_Focus_Child

- To API doc
- To spec

Set_Focus_Hadjustment

- To API doc
- To spec

Set_Focus_Vadjustment

- To API doc
- To spec

Set_Reallocate_Redraws

- To API doc
- To spec

Set_Resize_Mode

- To API doc
- To spec

Unset_Focus_Chain

- To API doc
- To spec

# Types

### Gtk_Container

- Goto declaration in source

    type Gtk_Container is access all Gtk_Container_Record'Class;

### Gtk_Callback

- Goto declaration in source

    type Gtk_Callback is
         access procedure (Item : access Gtk.Widget.Gtk_Widget_Record'Class);

Function that can be call for each child of a container. This is called automatically by the Forall subprogram below.

# Constants & Global variables

### Border_Width_Property

- Goto declaration in source

(Glib.Properties.Property_Uint)

    Border_Width_Property       : constant Glib.Properties.Property_Uint;

### Resize_Mode_Property

- Goto declaration in source

(Gtk.Enums.Property_Gtk_Resize_Mode)

    Resize_Mode_Property        : constant Gtk.Enums.Property_Gtk_Resize_Mode;

### Child_Property

- Goto declaration in source

(Glib.Properties.Property_Object_WO)

    Child_Property              : constant Glib.Properties.Property_Object_WO;

### Reallocate_Redraws_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Reallocate_Redraws_Property : constant Glib.Properties.Property_Boolean;

### Signal_Add

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Add             : constant Glib.Signal_Name := "add";

### Signal_Check_Resize

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Check_Resize    : constant Glib.Signal_Name := "check_resize";

### Signal_Remove

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Remove          : constant Glib.Signal_Name := "remove";

### Signal_Set_Focus_Child

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Set_Focus_Child : constant Glib.Signal_Name := "set-focus-child";

# Subprograms & Entries

### Get_Type

- Goto spec in source
- Goto body in source

    function Get_Type return Glib.GType;

Return the internal value associated with a Gtk_Container.

### Set_Border_Width

- Goto spec in source

    procedure Set_Border_Width (Container: access Gtk_Container_Record;Border_Width: Guint);

### Get_Border_Width

- Goto spec in source

    function Get_Border_Width (Container: access Gtk_Container_Record) return Guint;

Modify the size of the frame that surrounds the widget. The exact visual impact depends on the specific widget class.

### Add

- Goto spec in source

    procedure Add (Container: access Gtk_Container_Record;Widget: access Gtk.Widget.Gtk_Widget_Record'Class);

Add a new child to the container. Note that some containers can have only one child. Nothing is done if there is already a child. This basically sends the "add" signal (see below)

### Remove

- Goto spec in source

    procedure Remove (Container: access Gtk_Container_Record;Widget: access Gtk.Widget.Gtk_Widget_Record'Class);

Removes Widget from Container. Widget must be inside Container. Note that Container will own a reference to Widget, and that this may be the last reference held; so removing a widget from its container can destroy that widget. If you want to use Widget again, you need to add a reference to it while it's not inside a container, using Glib.Object.Ref. If you don't want to use Widget again it's usually more efficient to simply destroy it directly using Gtk.Widget.Destroy since this will remove it from the container and help break any circular reference count cycles.

### Set_Resize_Mode

- Goto spec in source

    procedure Set_Resize_Mode (Container: access Gtk_Container_Record;Resize_Mode: Gtk.Enums.Gtk_Resize_Mode);

### Get_Resize_Mode

- Goto spec in source

    function Get_Resize_Mode (Container: access Gtk_Container_Record) return Gtk.Enums.Gtk_Resize_Mode;

Change the resizing behavior for the Container. The default value is Resize_Parent.

### Get_Children

- Goto spec in source

    function Get_Children (Container: access Gtk_Container_Record) return Gtk.Widget.Widget_List.Glist;

Return a list of all the children of the container. The caller must free the returned list.

### Propagate_Expose

- Goto spec in source

    procedure Propagate_Expose (Container: access Gtk_Container_Record;Child: access Gtk.Widget.Gtk_Widget_Record'Class;Event: Gdk.Event.Gdk_Event_Expose);

When a container receives an expose event, it must send synthetic expose events to all children that don't have their own Gdk_Window. This function provides a convenient way of doing this. A container, when it receives an expose event, Propagate_Expose once for each child, passing in the event the container received. Propagate_Expose takes care of deciding whether an expose event needs to be sent to the child, intersecting the event's area with the child area, and sending the event. In most cases, a container can simply either simply inherit the expose implementation from Gtk_Container, or, do some drawing and then chain to the expose implementation from Gtk_Container.

### Set_Focus_Chain

- Goto spec in source

    procedure Set_Focus_Chain (Container: access Gtk_Container_Record;Focusable_Widgets: Gtk.Widget.Widget_List.Glist);

Set the chain of widgets that can take the focus for a given Container. The list should be freed by the user. This list indicates in which order the widgets will get the focus when the user presses tab or the arrow keys to move from one widget to the next.

### Get_Focus_Chain

- Goto spec in source

    procedure Get_Focus_Chain (Container: access Gtk_Container_Record;Focusable_Widgets: out Gtk.Widget.Widget_List.Glist;Success: out Boolean);

Retrieves the focus chain of the container, if one has been set explicitly. If no focus chain has been explicitly set, GTK+ computes the focus chain based on the positions of the children. In that case, GTK+ stores null in Focusable_Widgets and returns FALSE. The returned list must be freed by the user.

### Unset_Focus_Chain

- Goto spec in source

    procedure Unset_Focus_Chain (Container: access Gtk_Container_Record);

Undoes the effect of Set_Focus_Chain

### Set_Focus_Vadjustment

- Goto spec in source

    procedure Set_Focus_Vadjustment (Container: access Gtk_Container_Record;Adjustment: Gtk.Adjustment.Gtk_Adjustment);

### Get_Focus_Vadjustment

- Goto spec in source

    function Get_Focus_Vadjustment (Container: access Gtk_Container_Record) return Gtk.Adjustment.Gtk_Adjustment;

Set the focus to the vertical adjustment. Adjustment should have been created and displayed at some other place in your application. Container will make sure that Adjustment always matches the range for the focus widget's position (y .. y + height).

### Set_Focus_Hadjustment

- Goto spec in source

    procedure Set_Focus_Hadjustment (Container: access Gtk_Container_Record;Adjustment: Gtk.Adjustment.Gtk_Adjustment);

### Get_Focus_Hadjustment

- Goto spec in source

    function Get_Focus_Hadjustment (Container: access Gtk_Container_Record) return Gtk.Adjustment.Gtk_Adjustment;

Set the focus to the horizontal adjustment. Adjustment should have been created and displayed at some other place in your application. Container will make sure that Adjustment always matches the range for the focus widget's position (x .. x + width).

### Set_Focus_Child

- Goto spec in source

    procedure Set_Focus_Child (Container: access Gtk_Container_Record;Child: access Gtk.Widget.Gtk_Widget_Record'Class);

### Get_Focus_Child

- Goto spec in source

    function Get_Focus_Child (Container: access Gtk_Container_Record) return Gtk.Widget.Gtk_Widget;

Emit a "set_focus_child" signal, to set the child that currently has the keyboard focus.

### Child_Set_Property

- Goto spec in source

    procedure Child_Set_Property (Container: access Gtk_Container_Record;Child: access Gtk.Widget.Gtk_Widget_Record'Class;Property_Name: String;Value: Glib.Values.GValue);

### Child_Get_Property

- Goto spec in source

    procedure Child_Get_Property (Container: access Gtk_Container_Record;Child: access Gtk.Widget.Gtk_Widget_Record'Class;Property_Name: String;Value: out Glib.Values.GValue);

Sets or Gets the value of a child property for Child and Container. This is property set at the container level, and that applies to all children of that container. These are special type of properties, different from the properties associated with each type of widget. See also Gtk.Widget.Child_Notify You should use Glib.Property_Name to get the name from the property declaration in each of the GtkAda packages

### Class_Find_Child_Property

- Goto spec in source

    function Class_Find_Child_Property (Cclass: Glib.Object.GObject_Class;Property_Name: String) return Glib.Param_Spec;

Finds a child property of a container class by name. The returned value describes the property (type, allowed range, description,...) You should use Glib.Property_Name to get the name from the property declaration in each of the GtkAda packages

### Class_Install_Child_Property

- Goto spec in source

    procedure Class_Install_Child_Property (Cclass: Glib.Object.GObject_Class;Property_Id: Guint;Pspec: Glib.Param_Spec);

Installs a child property on a container class. The Property_Id is an custom id that you choose for your class. It will be used in signals that set or get the property, instead of passing around a string.

### Class_List_Child_Properties

- Goto spec in source

    function Class_List_Child_Properties (Cclass: Glib.Object.GObject_Class) return Glib.Param_Spec_Array;

Returns all child properties of a container class.

### Forall

- Goto spec in source

    procedure Forall (Container: access Gtk_Container_Record;Func: Gtk_Callback);

Invokes Func on each child of Container, including children that are considered "internal" (implementation details of the container). "Internal" children generally weren't added by the user of the container, but were added by the container implementation itself. See Gtk.Widget.Set_Composite_Name. Most applications should use gtk_container_foreach(), rather than gtk_container_forall(). See also the generic package Forall_Pkg if you want to pass some extra data to Func.

### Foreach

- Goto spec in source

    procedure Foreach (Container: access Gtk_Container_Record;Func: Gtk_Callback);

Invokes Func on each non-internal child of Container. See Forall for details on what constitutes an "internal" child.

### Set_Reallocate_Redraws

- Goto spec in source

    procedure Set_Reallocate_Redraws (Container: access Gtk_Container_Record;Needs_Redraws: Boolean := False);

Set the "needs_redraws" field. If Needs_Redraws is True, then a "draw" signal is emitted for the Container whenever one is emitted for a child.

### Child_Type

- Goto spec in source

    function Child_Type (Container: access Gtk_Container_Record) return Gtk.Gtk_Type;

Return the type of the children in Container. If Container can contain any type of widget, Gtk_Type_None is returned.

### Resize_Children

- Goto spec in source

    procedure Resize_Children (Container: access Gtk_Container_Record);

The container hasn't changed size but one of its children queued a resize request. Which means that the allocation is not sufficient for the requisition of some child. Run through the list of widgets and reallocate their size appropriately.

### Check_Resize

- Goto spec in source

    procedure Check_Resize (Container: access Gtk_Container_Record);

Emit the "check_resize" signal

### Children

- Goto spec in source

    function Children (Container: access Gtk_Container_Record) return Gtk.Widget.Widget_List.Glist renames Get_Children;

pragma Obsolescent;