Wrote the README_GIT file to be a proper tutorial on git, repo.or.cz and gtkD.
[gtkD.git] / gtkD / src / gtk / Container.d
blob1cf005c20721013c4c39ead51de3557a068cf868
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkContainer.html
26 * outPack = gtk
27 * outFile = Container
28 * strct = GtkContainer
29 * realStrct=
30 * ctorStrct=
31 * clss = Container
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_container_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gtk.Adjustment
47 * - glib.ListG
48 * - gobject.Value
49 * structWrap:
50 * - GList* -> ListG
51 * - GValue* -> Value
52 * - GtkAdjustment* -> Adjustment
53 * - GtkContainerClass* -> Container
54 * - GtkWidget* -> Widget
55 * module aliases:
56 * local aliases:
59 module gtk.Container;
61 version(noAssert)
63 version(Tango)
65 import tango.io.Stdout; // use the tango loging?
69 private import gtkc.gtktypes;
71 private import gtkc.gtk;
74 private import glib.Str;
75 private import gtk.Adjustment;
76 private import glib.ListG;
77 private import gobject.Value;
82 /**
83 * Description
84 * A GTK+ user interface is constructed by nesting widgets inside widgets. Container widgets are the inner
85 * nodes in the resulting tree of widgets: they contain other widgets. So, for example, you might have a
86 * GtkWindow containing a GtkFrame containing a GtkLabel. If you wanted an image instead of a textual label
87 * inside the frame, you might replace the GtkLabel widget with a GtkImage widget.
88 * There are two major kinds of container widgets in GTK+. Both are subclasses of the abstract GtkContainer
89 * base class.
90 * The first type of container widget has a single child widget and derives from GtkBin. These containers
91 * are decorators, which add some kind of functionality to the child. For example,
92 * a GtkButton makes its child into a clickable button; a GtkFrame draws a frame around its child and
93 * a GtkWindow places its child widget inside a top-level window.
94 * The second type of container can have more than one child; its purpose is to manage
95 * layout. This means that these containers assign sizes and positions to their children.
96 * For example, a GtkHBox arranges its children in a horizontal row, and a GtkTable arranges the widgets it
97 * contains in a two-dimensional grid.
98 * To fulfill its task, a layout container must negotiate the size requirements with its parent and its children.
99 * This negotiation is carried out in two phases, size requisition and
100 * size allocation.
101 * Size Requisition
102 * The size requisition of a widget is it's desired width and height. This is represented by a GtkRequisition.
103 * How a widget determines its desired size depends on the widget. A GtkLabel, for example, requests enough space
104 * to display all its text. Container widgets generally base their size request on the requisitions of their
105 * children.
106 * The size requisition phase of the widget layout process operates top-down. It starts at a top-level widget,
107 * typically a GtkWindow. The top-level widget asks its child for its size requisition by calling
108 * gtk_widget_size_request(). To determine its requisition, the child asks its own children for their requisitions
109 * and so on. Finally, the top-level widget will get a requisition back from its child.
110 * <hr>
111 * Size Allocation
112 * When the top-level widget has determined how much space its child would like to have, the second phase of the
113 * size negotiation, size allocation, begins. Depending on its configuration (see gtk_window_set_resizable()), the
114 * top-level widget may be able to expand in order to satisfy the size request or it may have to ignore the size
115 * request and keep its fixed size. It then tells its child widget how much space it gets by calling
116 * gtk_widget_size_allocate(). The child widget divides the space among its children and tells each child how much
117 * space it got, and so on. Under normal circumstances, a GtkWindow will always give its child the amount of space
118 * the child requested.
119 * A child's size allocation is represented by a GtkAllocation. This struct contains not only a width and height,
120 * but also a position (i.e. X and Y coordinates), so that containers can tell their children not only how much
121 * space they have gotten, but also where they are positioned inside the space available to the container.
122 * Widgets are required to honor the size allocation they receive; a size request is only a request, and widgets
123 * must be able to cope with any size.
124 * <hr>
125 * Child properties
126 * GtkContainer introduces child
127 * properties - these are object properties that are not specific
128 * to either the container or the contained widget, but rather to their relation.
129 * Typical examples of child properties are the position or pack-type of a widget
130 * which is contained in a GtkBox.
131 * Use gtk_container_class_install_child_property() to install child properties
132 * for a container class and gtk_container_class_find_child_property() or
133 * gtk_container_class_list_child_properties() to get information about existing
134 * child properties.
135 * To set the value of a child property, use gtk_container_child_set_property(),
136 * gtk_container_child_set() or gtk_container_child_set_valist().
137 * To obtain the value of a child property, use
138 * gtk_container_child_get_property(), gtk_container_child_get() or
139 * gtk_container_child_get_valist(). To emit notification about child property
140 * changes, use gtk_widget_child_notify().
142 private import gtk.Widget;
143 public class Container : Widget
146 /** the main Gtk struct */
147 protected GtkContainer* gtkContainer;
150 public GtkContainer* getContainerStruct()
152 return gtkContainer;
156 /** the main Gtk struct as a void* */
157 protected void* getStruct()
159 return cast(void*)gtkContainer;
163 * Sets our main struct and passes it to the parent class
165 public this (GtkContainer* gtkContainer)
167 version(noAssert)
169 if ( gtkContainer is null )
171 int zero = 0;
172 version(Tango)
174 Stdout("struct gtkContainer is null on constructor").newline;
176 else
178 printf("struct gtkContainer is null on constructor");
180 zero = zero / zero;
183 else
185 assert(gtkContainer !is null, "struct gtkContainer is null on constructor");
187 super(cast(GtkWidget*)gtkContainer);
188 this.gtkContainer = gtkContainer;
192 * Removes all widgets from the container
194 void removeAll()
196 GList* gList = gtk_container_get_children(getContainerStruct());
197 if ( gList !is null )
199 ListG children = new ListG(gList);
200 for ( int i=children.length()-1 ; i>=0 ; i-- )
202 gtk_container_remove(getContainerStruct(), cast(GtkWidget*)children.nthData(i));
210 // imports for the signal processing
211 private import gobject.Signals;
212 private import gtkc.gdktypes;
213 int[char[]] connectedSignals;
215 void delegate(Widget, Container)[] onAddListeners;
216 void addOnAdd(void delegate(Widget, Container) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
218 if ( !("add" in connectedSignals) )
220 Signals.connectData(
221 getStruct(),
222 "add",
223 cast(GCallback)&callBackAdd,
224 cast(void*)this,
225 null,
226 connectFlags);
227 connectedSignals["add"] = 1;
229 onAddListeners ~= dlg;
231 extern(C) static void callBackAdd(GtkContainer* containerStruct, GtkWidget* widget, Container container)
233 bool consumed = false;
235 foreach ( void delegate(Widget, Container) dlg ; container.onAddListeners )
237 dlg(new Widget(widget), container);
240 return consumed;
243 void delegate(Container)[] onCheckResizeListeners;
244 void addOnCheckResize(void delegate(Container) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
246 if ( !("check-resize" in connectedSignals) )
248 Signals.connectData(
249 getStruct(),
250 "check-resize",
251 cast(GCallback)&callBackCheckResize,
252 cast(void*)this,
253 null,
254 connectFlags);
255 connectedSignals["check-resize"] = 1;
257 onCheckResizeListeners ~= dlg;
259 extern(C) static void callBackCheckResize(GtkContainer* containerStruct, Container container)
261 bool consumed = false;
263 foreach ( void delegate(Container) dlg ; container.onCheckResizeListeners )
265 dlg(container);
268 return consumed;
271 void delegate(Widget, Container)[] onRemoveListeners;
272 void addOnRemove(void delegate(Widget, Container) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
274 if ( !("remove" in connectedSignals) )
276 Signals.connectData(
277 getStruct(),
278 "remove",
279 cast(GCallback)&callBackRemove,
280 cast(void*)this,
281 null,
282 connectFlags);
283 connectedSignals["remove"] = 1;
285 onRemoveListeners ~= dlg;
287 extern(C) static void callBackRemove(GtkContainer* containerStruct, GtkWidget* widget, Container container)
289 bool consumed = false;
291 foreach ( void delegate(Widget, Container) dlg ; container.onRemoveListeners )
293 dlg(new Widget(widget), container);
296 return consumed;
299 void delegate(Widget, Container)[] onSetFocusChildListeners;
300 void addOnSetFocusChild(void delegate(Widget, Container) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
302 if ( !("set-focus-child" in connectedSignals) )
304 Signals.connectData(
305 getStruct(),
306 "set-focus-child",
307 cast(GCallback)&callBackSetFocusChild,
308 cast(void*)this,
309 null,
310 connectFlags);
311 connectedSignals["set-focus-child"] = 1;
313 onSetFocusChildListeners ~= dlg;
315 extern(C) static void callBackSetFocusChild(GtkContainer* containerStruct, GtkWidget* widget, Container container)
317 bool consumed = false;
319 foreach ( void delegate(Widget, Container) dlg ; container.onSetFocusChildListeners )
321 dlg(new Widget(widget), container);
324 return consumed;
333 * Adds widget to container. Typically used for simple containers
334 * such as GtkWindow, GtkFrame, or GtkButton; for more complicated
335 * layout containers such as GtkBox or GtkTable, this function will
336 * pick default packing parameters that may not be correct. So
337 * consider functions such as gtk_box_pack_start() and
338 * gtk_table_attach() as an alternative to gtk_container_add() in
339 * those cases. A widget may be added to only one container at a time;
340 * you can't place the same widget inside two different containers.
341 * container:
342 * a GtkContainer
343 * widget:
344 * a widget to be placed inside container
346 public void add(Widget widget)
348 // void gtk_container_add (GtkContainer *container, GtkWidget *widget);
349 gtk_container_add(gtkContainer, (widget is null) ? null : widget.getWidgetStruct());
353 * Removes widget from container. widget must be inside container.
354 * Note that container will own a reference to widget, and that this
355 * may be the last reference held; so removing a widget from its
356 * container can destroy that widget. If you want to use widget
357 * again, you need to add a reference to it while it's not inside
358 * a container, using g_object_ref(). If you don't want to use widget
359 * again it's usually more efficient to simply destroy it directly
360 * using gtk_widget_destroy() since this will remove it from the
361 * container and help break any circular reference count cycles.
362 * container:
363 * a GtkContainer
364 * widget:
365 * a current child of container
367 public void remove(Widget widget)
369 // void gtk_container_remove (GtkContainer *container, GtkWidget *widget);
370 gtk_container_remove(gtkContainer, (widget is null) ? null : widget.getWidgetStruct());
374 * Adds widget to container, setting child properties at the same time.
375 * See gtk_container_add() and gtk_container_child_set() for more details.
376 * container:
377 * a GtkContainer
378 * widget:
379 * a widget to be placed inside container
380 * first_prop_name:
381 * the name of the first child property to set
382 * ...:
383 * a NULL-terminated list of property names and values, starting
384 * with first_prop_name.
386 public void addWithProperties(Widget widget, char[] firstPropName, ... )
388 // void gtk_container_add_with_properties (GtkContainer *container, GtkWidget *widget, const gchar *first_prop_name, ...);
389 gtk_container_add_with_properties(gtkContainer, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(firstPropName));
393 * Returns the resize mode for the container. See
394 * gtk_container_set_resize_mode().
395 * container:
396 * a GtkContainer
397 * Returns:
398 * the current resize mode
400 public GtkResizeMode getResizeMode()
402 // GtkResizeMode gtk_container_get_resize_mode (GtkContainer *container);
403 return gtk_container_get_resize_mode(gtkContainer);
407 * Sets the resize mode for the container.
408 * The resize mode of a container determines whether a resize request
409 * will be passed to the container's parent, queued for later execution
410 * or executed immediately.
411 * container:
412 * a GtkContainer.
413 * resize_mode:
414 * the new resize mode.
416 public void setResizeMode(GtkResizeMode resizeMode)
418 // void gtk_container_set_resize_mode (GtkContainer *container, GtkResizeMode resize_mode);
419 gtk_container_set_resize_mode(gtkContainer, resizeMode);
423 * container:
425 public void checkResize()
427 // void gtk_container_check_resize (GtkContainer *container);
428 gtk_container_check_resize(gtkContainer);
432 * Invokes callback on each non-internal child of container. See
433 * gtk_container_forall() for details on what constitutes an
434 * "internal" child. Most applications should use
435 * gtk_container_foreach(), rather than gtk_container_forall().
436 * container:
437 * a GtkContainer
438 * callback:
439 * a callback
440 * callback_data:
441 * callback user data
443 public void foreac(GtkCallback callback, void* callbackData)
445 // void gtk_container_foreach (GtkContainer *container, GtkCallback callback, gpointer callback_data);
446 gtk_container_foreach(gtkContainer, callback, callbackData);
450 * Warning
451 * gtk_container_foreach_full is deprecated and should not be used in newly-written code. Use gtk_container_foreach() instead.
452 * container:
453 * callback:
454 * marshal:
455 * callback_data:
456 * notify:
458 public void foreachFull(GtkCallback callback, GtkCallbackMarshal marshal, void* callbackData, GtkDestroyNotify notify)
460 // void gtk_container_foreach_full (GtkContainer *container, GtkCallback callback, GtkCallbackMarshal marshal, gpointer callback_data, GtkDestroyNotify notify);
461 gtk_container_foreach_full(gtkContainer, callback, marshal, callbackData, notify);
466 * Returns the container's non-internal children. See
467 * gtk_container_forall() for details on what constitutes an "internal" child.
468 * container:
469 * a GtkContainer.
470 * Returns:
471 * a newly-allocated list of the container's non-internal children.
473 public ListG getChildren()
475 // GList* gtk_container_get_children (GtkContainer *container);
476 return new ListG( gtk_container_get_children(gtkContainer) );
480 * Sets the reallocate_redraws flag of the container to the given value.
481 * Containers requesting reallocation redraws get automatically
482 * redrawn if any of their children changed allocation.
483 * container:
484 * a GtkContainer.
485 * needs_redraws:
486 * the new value for the container's reallocate_redraws flag.
488 public void setReallocateRedraws(int needsRedraws)
490 // void gtk_container_set_reallocate_redraws (GtkContainer *container, gboolean needs_redraws);
491 gtk_container_set_reallocate_redraws(gtkContainer, needsRedraws);
495 * container:
496 * child:
498 public void setFocusChild(Widget child)
500 // void gtk_container_set_focus_child (GtkContainer *container, GtkWidget *child);
501 gtk_container_set_focus_child(gtkContainer, (child is null) ? null : child.getWidgetStruct());
505 * Retrieves the vertical focus adjustment for the container. See
506 * gtk_container_set_focus_vadjustment().
507 * container:
508 * a GtkContainer
509 * Returns:
510 * the vertical focus adjustment, or NULL if
511 * none has been set.
513 public Adjustment getFocusVadjustment()
515 // GtkAdjustment* gtk_container_get_focus_vadjustment (GtkContainer *container);
516 return new Adjustment( gtk_container_get_focus_vadjustment(gtkContainer) );
520 * Hooks up an adjustment to focus handling in a container, so when a child of the
521 * container is focused, the adjustment is scrolled to show that widget. This function
522 * sets the vertical alignment. See gtk_scrolled_window_get_vadjustment() for a typical
523 * way of obtaining the adjustment and gtk_container_set_focus_hadjustment() for setting
524 * the horizontal adjustment.
525 * The adjustments have to be in pixel units and in the same coordinate system as the
526 * allocation for immediate children of the container.
527 * container:
528 * a GtkContainer
529 * adjustment:
530 * an adjustment which should be adjusted when the focus is moved among the
531 * descendents of container
533 public void setFocusVadjustment(Adjustment adjustment)
535 // void gtk_container_set_focus_vadjustment (GtkContainer *container, GtkAdjustment *adjustment);
536 gtk_container_set_focus_vadjustment(gtkContainer, (adjustment is null) ? null : adjustment.getAdjustmentStruct());
540 * Retrieves the horizontal focus adjustment for the container. See
541 * gtk_container_set_focus_hadjustment().
542 * container:
543 * a GtkContainer
544 * Returns:
545 * the horizontal focus adjustment, or NULL if
546 * none has been set.
548 public Adjustment getFocusHadjustment()
550 // GtkAdjustment* gtk_container_get_focus_hadjustment (GtkContainer *container);
551 return new Adjustment( gtk_container_get_focus_hadjustment(gtkContainer) );
555 * Hooks up an adjustment to focus handling in a container, so when a child of the
556 * container is focused, the adjustment is scrolled to show that widget. This function
557 * sets the horizontal alignment. See gtk_scrolled_window_get_hadjustment() for a typical
558 * way of obtaining the adjustment and gtk_container_set_focus_vadjustment() for setting
559 * the vertical adjustment.
560 * The adjustments have to be in pixel units and in the same coordinate system as the
561 * allocation for immediate children of the container.
562 * container:
563 * a GtkContainer
564 * adjustment:
565 * an adjustment which should be adjusted when the focus is moved among the
566 * descendents of container
568 public void setFocusHadjustment(Adjustment adjustment)
570 // void gtk_container_set_focus_hadjustment (GtkContainer *container, GtkAdjustment *adjustment);
571 gtk_container_set_focus_hadjustment(gtkContainer, (adjustment is null) ? null : adjustment.getAdjustmentStruct());
575 * container:
577 public void resizeChildren()
579 // void gtk_container_resize_children (GtkContainer *container);
580 gtk_container_resize_children(gtkContainer);
584 * Returns the type of the children supported by the container.
585 * Note that this may return G_TYPE_NONE to indicate that no more
586 * children can be added, e.g. for a GtkPaned which already has two
587 * children.
588 * container:
589 * a GtkContainer.
590 * Returns:
591 * a GType.
593 public GType childType()
595 // GType gtk_container_child_type (GtkContainer *container);
596 return gtk_container_child_type(gtkContainer);
600 * Gets the values of one or more child properties for child and container.
601 * container:
602 * a GtkContainer
603 * child:
604 * a widget which is a child of container
605 * first_prop_name:
606 * the name of the first property to get
607 * ...:
608 * a NULL-terminated list of property names and GValue*,
609 * starting with first_prop_name.
611 public void childGet(Widget child, char[] firstPropName, ... )
613 // void gtk_container_child_get (GtkContainer *container, GtkWidget *child, const gchar *first_prop_name, ...);
614 gtk_container_child_get(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(firstPropName));
618 * Sets one or more child properties for child and container.
619 * container:
620 * a GtkContainer
621 * child:
622 * a widget which is a child of container
623 * first_prop_name:
624 * the name of the first property to set
625 * ...:
626 * a NULL-terminated list of property names and values, starting
627 * with first_prop_name.
629 public void childSet(Widget child, char[] firstPropName, ... )
631 // void gtk_container_child_set (GtkContainer *container, GtkWidget *child, const gchar *first_prop_name, ...);
632 gtk_container_child_set(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(firstPropName));
636 * Gets the value of a child property for child and container.
637 * container:
638 * a GtkContainer
639 * child:
640 * a widget which is a child of container
641 * property_name:
642 * the name of the property to get
643 * value:
644 * a location to return the value
646 public void childGetProperty(Widget child, char[] propertyName, Value value)
648 // void gtk_container_child_get_property (GtkContainer *container, GtkWidget *child, const gchar *property_name, GValue *value);
649 gtk_container_child_get_property(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(propertyName), (value is null) ? null : value.getValueStruct());
653 * Sets a child property for child and container.
654 * container:
655 * a GtkContainer
656 * child:
657 * a widget which is a child of container
658 * property_name:
659 * the name of the property to set
660 * value:
661 * the value to set the property to
663 public void childSetProperty(Widget child, char[] propertyName, Value value)
665 // void gtk_container_child_set_property (GtkContainer *container, GtkWidget *child, const gchar *property_name, const GValue *value);
666 gtk_container_child_set_property(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(propertyName), (value is null) ? null : value.getValueStruct());
670 * Gets the values of one or more child properties for child and container.
671 * container:
672 * a GtkContainer
673 * child:
674 * a widget which is a child of container
675 * first_property_name:
676 * the name of the first property to get
677 * var_args:
678 * a NULL-terminated list of property names and GValue*,
679 * starting with first_prop_name.
681 public void childGetValist(Widget child, char[] firstPropertyName, void* varArgs)
683 // void gtk_container_child_get_valist (GtkContainer *container, GtkWidget *child, const gchar *first_property_name, va_list var_args);
684 gtk_container_child_get_valist(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(firstPropertyName), varArgs);
688 * Sets one or more child properties for child and container.
689 * container:
690 * a GtkContainer
691 * child:
692 * a widget which is a child of container
693 * first_property_name:
694 * the name of the first property to set
695 * var_args:
696 * a NULL-terminated list of property names and values, starting
697 * with first_prop_name.
699 public void childSetValist(Widget child, char[] firstPropertyName, void* varArgs)
701 // void gtk_container_child_set_valist (GtkContainer *container, GtkWidget *child, const gchar *first_property_name, va_list var_args);
702 gtk_container_child_set_valist(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(firstPropertyName), varArgs);
706 * Invokes callback on each child of container, including children
707 * that are considered "internal" (implementation details of the
708 * container). "Internal" children generally weren't added by the user
709 * of the container, but were added by the container implementation
710 * itself. Most applications should use gtk_container_foreach(),
711 * rather than gtk_container_forall().
712 * container:
713 * a GtkContainer
714 * callback:
715 * a callback
716 * callback_data:
717 * callback user data
719 public void forall(GtkCallback callback, void* callbackData)
721 // void gtk_container_forall (GtkContainer *container, GtkCallback callback, gpointer callback_data);
722 gtk_container_forall(gtkContainer, callback, callbackData);
726 * Retrieves the border width of the container. See
727 * gtk_container_set_border_width().
728 * container:
729 * a GtkContainer
730 * Returns:
731 * the current border width
733 public uint getBorderWidth()
735 // guint gtk_container_get_border_width (GtkContainer *container);
736 return gtk_container_get_border_width(gtkContainer);
740 * Sets the border width of the container.
741 * The border width of a container is the amount of space to leave
742 * around the outside of the container. The only exception to this is
743 * GtkWindow; because toplevel windows can't leave space outside,
744 * they leave the space inside. The border is added on all sides of
745 * the container. To add space to only one side, one approach is to
746 * create a GtkAlignment widget, call gtk_widget_set_usize() to give
747 * it a size, and place it on the side of the container as a spacer.
748 * container:
749 * a GtkContainer
750 * border_width:
751 * amount of blank space to leave outside the container.
752 * Valid values are in the range 0-65535 pixels.
754 public void setBorderWidth(uint borderWidth)
756 // void gtk_container_set_border_width (GtkContainer *container, guint border_width);
757 gtk_container_set_border_width(gtkContainer, borderWidth);
761 * When a container receives an expose event, it must send synthetic
762 * expose events to all children that don't have their own GdkWindows.
763 * This function provides a convenient way of doing this. A container,
764 * when it receives an expose event, calls gtk_container_propagate_expose()
765 * once for each child, passing in the event the container received.
766 * gtk_container_propagate_expose() takes care of deciding whether
767 * an expose event needs to be sent to the child, intersecting
768 * the event's area with the child area, and sending the event.
769 * In most cases, a container can simply either simply inherit the
770 * ::expose implementation from GtkContainer, or, do some drawing
771 * and then chain to the ::expose implementation from GtkContainer.
772 * container:
773 * a GtkContainer
774 * child:
775 * a child of container
776 * event:
777 * a expose event sent to container
779 public void propagateExpose(Widget child, GdkEventExpose* event)
781 // void gtk_container_propagate_expose (GtkContainer *container, GtkWidget *child, GdkEventExpose *event);
782 gtk_container_propagate_expose(gtkContainer, (child is null) ? null : child.getWidgetStruct(), event);
786 * Retrieves the focus chain of the container, if one has been
787 * set explicitly. If no focus chain has been explicitly
788 * set, GTK+ computes the focus chain based on the positions
789 * of the children. In that case, GTK+ stores NULL in
790 * focusable_widgets and returns FALSE.
791 * container:
792 * a GtkContainer
793 * focusable_widgets:
794 * location to store the focus chain of the
795 * container, or NULL. You should free this list
796 * using g_list_free() when you are done with it, however
797 * no additional reference count is added to the
798 * individual widgets in the focus chain.
799 * Returns:
800 * TRUE if the focus chain of the container
801 * has been set explicitly.
803 public int getFocusChain(GList** focusableWidgets)
805 // gboolean gtk_container_get_focus_chain (GtkContainer *container, GList **focusable_widgets);
806 return gtk_container_get_focus_chain(gtkContainer, focusableWidgets);
810 * Sets a focus chain, overriding the one computed automatically by GTK+.
811 * In principle each widget in the chain should be a descendant of the
812 * container, but this is not enforced by this method, since it's allowed
813 * to set the focus chain before you pack the widgets, or have a widget
814 * in the chain that isn't always packed. The necessary checks are done
815 * when the focus chain is actually traversed.
816 * container:
817 * a GtkContainer.
818 * focusable_widgets:
819 * the new focus chain.
821 public void setFocusChain(ListG focusableWidgets)
823 // void gtk_container_set_focus_chain (GtkContainer *container, GList *focusable_widgets);
824 gtk_container_set_focus_chain(gtkContainer, (focusableWidgets is null) ? null : focusableWidgets.getListGStruct());
828 * Removes a focus chain explicitly set with gtk_container_set_focus_chain().
829 * container:
830 * a GtkContainer.
832 public void unsetFocusChain()
834 // void gtk_container_unset_focus_chain (GtkContainer *container);
835 gtk_container_unset_focus_chain(gtkContainer);
839 * Finds a child property of a container class by name.
840 * cclass:
841 * a GtkContainerClass
842 * property_name:
843 * the name of the child property to find
844 * Returns:
845 * the GParamSpec of the child property or NULL if class has no
846 * child property with that name.
848 public static GParamSpec* classFindChildProperty(GObjectClass* cclass, char[] propertyName)
850 // GParamSpec* gtk_container_class_find_child_property (GObjectClass *cclass, const gchar *property_name);
851 return gtk_container_class_find_child_property(cclass, Str.toStringz(propertyName));
855 * Installs a child property on a container class.
856 * cclass:
857 * a GtkContainerClass
858 * property_id:
859 * the id for the property
860 * pspec:
861 * the GParamSpec for the property
863 public static void classInstallChildProperty(Container cclass, uint propertyId, GParamSpec* pspec)
865 // void gtk_container_class_install_child_property (GtkContainerClass *cclass, guint property_id, GParamSpec *pspec);
866 gtk_container_class_install_child_property((cclass is null) ? null : cclass.getContainerStruct(), propertyId, pspec);
870 * Returns all child properties of a container class.
871 * cclass:
872 * a GtkContainerClass
873 * n_properties:
874 * location to return the number of child properties found
875 * Returns:
876 * a newly allocated NULL-terminated array of GParamSpec*.
877 * The array must be freed with g_free().
878 * Property Details
879 * The "border-width" property
880 * "border-width" guint : Read / Write
881 * The width of the empty border outside the containers children.
882 * Allowed values: <= G_MAXINT
883 * Default value: 0
885 public static GParamSpec** classListChildProperties(GObjectClass* cclass, uint* nProperties)
887 // GParamSpec** gtk_container_class_list_child_properties (GObjectClass *cclass, guint *n_properties);
888 return gtk_container_class_list_child_properties(cclass, nProperties);