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.
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) |
Signals |
---|
Types |
---|
type Forall_Function 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.
|
Subprograms |
---|
function Get_Type return Glib.GType; | ||
Return the internal value associated with a Gtk_Container.
| ||
procedure Set_Border_Width (Container : access Gtk_Container_Record; Border_Width : Guint); | ||
Modify the size of the frame that surrounds the widget. | ||
function Get_Border_Width (Container : access Gtk_Container_Record) return Guint; | ||
Return the size of the frame that surrounds the widget.
| ||
procedure Add (Container : access Gtk_Container_Record; Widget : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Add a new child to the container. | ||
procedure Remove (Container : access Gtk_Container_Record; Widget : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Removes Widget from Container. Widget must be inside Container. | ||
procedure Set_Resize_Mode (Container : access Gtk_Container_Record; Resize_Mode : Gtk.Enums.Gtk_Resize_Mode); | ||
Change the resizing behavior for the Container. | ||
function Get_Resize_Mode (Container : access Gtk_Container_Record) return Gtk.Enums.Gtk_Resize_Mode; | ||
Return the resizing behavior for the Container.
| ||
function Get_Children (Container : access Gtk_Container_Record) return Gtk.Widget.Widget_List.Glist; | ||
Return a list of all the children of the container. | ||
function Children (Container : access Gtk_Container_Record) return Gtk.Widget.Widget_List.Glist; | ||
This function is deprecated.
| ||
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 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.
| ||
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. | ||
procedure Unset_Focus_Chain (Container : access Gtk_Container_Record); | ||
Unset the focus chain.
| ||
Foreach functions | ||
procedure Forall (Container : access Gtk_Container_Record; Func : Forall_Function); | ||
Execute Func for each of the children of Container. | ||
Widget-level methods | ||
procedure Set_Reallocate_Redraws (Container : access Gtk_Container_Record; Needs_Redraws : Boolean := False); | ||
Set the "needs_redraws" field. | ||
procedure Set_Focus_Vadjustment (Container : access Gtk_Container_Record; Adjustment : Gtk.Adjustment.Gtk_Adjustment); | ||
Set the focus to the vertical adjustment. | ||
procedure Set_Focus_Hadjustment (Container : access Gtk_Container_Record; Adjustment : Gtk.Adjustment.Gtk_Adjustment); | ||
Set the focus to the horizontal adjustment. | ||
function Child_Type (Container : access Gtk_Container_Record) return Gtk.Gtk_Type; | ||
Return the type of the children in Container. | ||
procedure Resize_Children (Container : access Gtk_Container_Record); | ||
The container hasn't changed size but one of its children | ||
Signals emission | ||
procedure Check_Resize (Container : access Gtk_Container_Record); | ||
Emit the "check_resize" signal
| ||
procedure Set_Focus_Child (Container : access Gtk_Container_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Emit a "set_focus_child" signal.
| ||
function Get_Focus_Child (Container : access Gtk_Container_Record) return Gtk.Widget.Gtk_Widget; | ||
Return the child that currently has the keyboard focus. Note that null |