gtk-sharpGtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.Gtk.WidgetSystem.Collections.IEnumerableBase class for widgets which contain other widgets
A Gtk# user interface is constructed by nesting widgets inside widgets. widgets are the inner nodes in the resulting tree of widgets: they contain other widgets. So, for example, you might have a containing a containing a . If you wanted an image instead of a textual label inside the frame, you might replace the widget with a widget.
There are two major kinds of widgets in Gtk#. Both are subclasses of the abstract base class.
The first type of widget has a single child widget and derives from . These containers are decorators, which add some kind of functionality to the child. For example, a makes its child into a clickable button; a draws a frame around its child and a places its child widget inside a top-level .
The second type of can have more than one child; its purpose is to manage layout. This means that these containers assign sizes and positions to their children. For example, a arranges its children in a horizontal row, and a arranges the widgets it contains in a two-dimensional grid.
To fulfill its task, a layout must negotiate the size requirements with its parent and its children. This negotiation is carried out in two phases, size requisition and size allocation.
ConstructorProtected constructor for chaining by descendant classes.Constructor
Pointer to the C object.
Internal constructorThis is an internal constructor, and should not be used by user code.MethodSystem.Void
an object of type Adds a to the .
Typically used for simple containers such as , , or ; for more complicated layout containers such as or , this function will pick default packing parameters that may not be correct. So consider functions such as and as an alternative to in those cases. A may be added to only one at a time; you can not place the same widget inside two different containers.
EventGLib.Signal("add")Gtk.AddedHandlerRaised when a child widget is added to the container via .Note that this event is raised only when (or its C equivalent) is called. It is not a generic widget-added notification. For example, calling will not result in this event firing.PropertySystem.Collections.IEnumerableAllows you to enumerate all of the container's children.an
Enumerates all of the container's children, including those widgets that are
internal implementation details of the container.
PropertyGLib.Property("border-width")System.UInt32This container's border width.A MethodSystem.VoidAttempts to resize this container.PropertyGLib.Property("child")Gtk.WidgetA child widget for this container.an object of type MethodGLib.Value
a child of this
the child property name
Gets a child property of a .To be added.You will not normally need to use this method; Gtk# automatically generates child property accessors for all subclasses.MethodSystem.Void
an object of type
an object of type
an object of type Gets the values of one or more child properties for child and container.Gets the values of one or more child properties for child and container.PropertyGtk.Widget[]Obtains an array of the container's (non-internal) children.An array of non-internal children.
Returns the container's non-internal children; that is, generally, the
children that were explicitly added to the container by the application, as
opposed to those widgets that are internal implementation details of the
container.
If you simply want to do a loop on the
container's children, you do not need to use the Children property.
Just do:
foreach (Widget w in myContainer) {
// Do something with w
}
MethodSystem.Void
a child of this
the child property name
the value to set to
Sets a child property of a .You will not normally need to use this method; Gtk# automatically generates child property accessors for all subclasses.MethodSystem.Void
an object of type
an object of type
an object of type Sets one or more child properties for child and .Sets one or more child properties for child and .MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideObsoleteChildType", Type=typeof(Gtk.Container))System.Obsolete("Replaced by OnChildType for implementations and SupportedChildType for callers.")GLib.GTypeReturns the type of children supported by this container.a
If you override this in a derived container class, you
must not call base.ChildType() from the overridden method.
PropertyGtk.Widget[]Sets or obtains a focus chain of the container, overriding the one computed automatically by Gtk#.An array of .
In principle each in the chain should be a descendant of the , but this is not enforced by this method, since it is allowed to set the focus chain before you pack the widgets, or have a widget in the chain that is not always packed. The necessary checks are done when the focus chain is actually traversed.
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 in focusable_widgets and returns .
PropertyGtk.WidgetMoves the focus to a particular child widget or finds the last-focused widget.an object of type EventGLib.Signal("set-focus-child")Gtk.FocusChildSetHandlerRaised when the focus moves to a child widget of this container.PropertyGtk.AdjustmentThe horizontal focus adjustment.an object of type PropertyGtk.AdjustmentThe vertical focus adjustment.an object of type MethodSystem.Void
a Invokes a callback function on each child of this 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. Most applications should use instead of this method.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideForall", Type=typeof(Gtk.Container))System.Void
a , whether to include "internal" children when running the callback.
a Run a given callback for every object inside this container.
Overload this in subclasses of Gtk.Container to implement the
and
methods.
MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideForallOld", Type=typeof(Gtk.Container))System.Obsolete("Override the ForAll(bool,Gtk.Callback) method instead")System.Void
a , whether to include "internal" children when running the callback.
a Run a given callback for every object inside this container.
Deprecated: overload instead.
MethodSystem.Void
a Invokes a callback function on each non-internal child of this container. See for more details on internal children. Most applications should use this method instead of .
MethodSystem.Collections.IEnumeratorReturns an for the container's childrena implements
, so you can iterate
through its children like this:
foreach (Widget w in myContainer) {
// Do something with w
}
MethodGtk.WidgetPath
To be added.
To be added.To be added.To be added.PropertyGLib.GTypeGType Property.a Returns the native value for .PropertyGtk.Container+ContainerChild
a child of this container
Access for child propertiesa The base type is not very useful; you will normally need to cast it to a subclass of the appropriate type.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideAdded", Type=typeof(Gtk.Container))System.Void
a Default handler for the event.Override this method in a subclass to provide a default handler for the event.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideChildType", Type=typeof(Gtk.Container))GLib.GTypeTo be added.To be added.To be added.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideCompositeName", Type=typeof(Gtk.Container))System.String
To be added.
To be added.To be added.To be added.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideFocusChildSet", Type=typeof(Gtk.Container))System.Void
a Default handler for the event.Override this method in a subclass to provide a default handler for the event.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideGetChildProperty", Type=typeof(Gtk.Container))System.Void
To be added.
To be added.
To be added.
To be added.
To be added.To be added.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideGetPathForChild", Type=typeof(Gtk.Container))Gtk.WidgetPath
To be added.
To be added.To be added.To be added.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideRemoved", Type=typeof(Gtk.Container))System.Void
a Default handler for the event.Override this method in a subclass to provide a default handler for the event.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideResizeChecked", Type=typeof(Gtk.Container))System.VoidDefault handler for the event.Override this method in a subclass to provide a default handler for the event.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideSetChildProperty", Type=typeof(Gtk.Container))System.Void
To be added.
To be added.
To be added.
To be added.
To be added.To be added.MethodSystem.Void
To be added.
To be added.
To be added.To be added.PropertySystem.BooleanThe redraw-reallocation flag. Containers requesting
reallocation redraws get automatically redrawn if any of their
children changed allocation. an object of type MethodSystem.Void
an object of type Removes a from the . must be inside .
EventGLib.Signal("remove")Gtk.RemovedHandlerRaised when a child widget is removed from this containerNote that this event is raised only when (or its C equivalent) is called. If a subclass defines additional methods for removing widgets, then calling those methods will not result in this event being raised.EventGLib.Signal("check-resize")System.EventHandlerRaised when this container's resizability is queried.MethodSystem.VoidTries to resize the child widgets of this container.PropertyGLib.Property("resize-mode")Gtk.ResizeModeHow this container behaves when resized.an object of type MethodGLib.GTypeTo be added.To be added.To be added.MethodSystem.VoidRemoves a focus chain.Removes a focus chain explicitly set with .