alternative to assert
[gtkD.git] / src / gtk / Container.d
blob9774026898ec2678726779dab3444aabeacd73db
1 /*
2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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 * local aliases:
58 module gtk.Container;
60 private import gtk.gtktypes;
62 private import lib.gtk;
64 private import glib.Str;
65 private import gtk.Adjustment;
66 private import glib.ListG;
67 private import gobject.Value;
69 /**
70 * Description
71 * A GTK+ user interface is constructed by nesting widgets inside widgets. Container widgets are the inner
72 * nodes in the resulting tree of widgets: they contain other widgets. So, for example, you might have a
73 * GtkWindow containing a GtkFrame containing a GtkLabel. If you wanted an image instead of a textual label
74 * inside the frame, you might replace the GtkLabel widget with a GtkImage widget.
75 * There are two major kinds of container widgets in GTK+. Both are subclasses of the abstract GtkContainer
76 * base class.
77 * The first type of container widget has a single child widget and derives from GtkBin. These containers
78 * are decorators, which add some kind of functionality to the child. For example,
79 * a GtkButton makes its child into a clickable button; a GtkFrame draws a frame around its child and
80 * a GtkWindow places its child widget inside a top-level window.
81 * The second type of container can have more than one child; its purpose is to manage
82 * layout. This means that these containers assign sizes and positions to their children.
83 * For example, a GtkHBox arranges its children in a horizontal row, and a GtkTable arranges the widgets it
84 * contains in a two-dimensional grid.
85 * To fulfill its task, a layout container must negotiate the size requirements with its parent and its children.
86 * This negotiation is carried out in two phases, size requisition and
87 * size allocation.
88 * Size Requisition
89 * The size requisition of a widget is it's desired width and height. This is represented by a GtkRequisition.
90 * How a widget determines its desired size depends on the widget. A GtkLabel, for example, requests enough space
91 * to display all its text. Container widgets generally base their size request on the requisitions of their
92 * children.
93 * The size requisition phase of the widget layout process operates top-down. It starts at a top-level widget,
94 * typically a GtkWindow. The top-level widget asks its child for its size requisition by calling
95 * gtk_widget_size_request(). To determine its requisition, the child asks its own children for their requisitions
96 * and so on. Finally, the top-level widget will get a requisition back from its child.
97 * <hr>
98 * Size Allocation
99 * When the top-level widget has determined how much space its child would like to have, the second phase of the
100 * size negotiation, size allocation, begins. Depending on its configuration (see gtk_window_set_resizable()), the
101 * top-level widget may be able to expand in order to satisfy the size request or it may have to ignore the size
102 * request and keep its fixed size. It then tells its child widget how much space it gets by calling
103 * gtk_widget_size_allocate(). The child widget divides the space among its children and tells each child how much
104 * space it got, and so on. Under normal circumstances, a GtkWindow will always give its child the amount of space
105 * the child requested.
106 * A child's size allocation is represented by a GtkAllocation. This struct contains not only a width and height,
107 * but also a position (i.e. X and Y coordinates), so that containers can tell their children not only how much
108 * space they have gotten, but also where they are positioned inside the space available to the container.
109 * Widgets are required to honor the size allocation they receive; a size request is only a request, and widgets
110 * must be able to cope with any size.
111 * <hr>
112 * Child properties
113 * GtkContainer introduces child
114 * properties - these are object properties that are not specific
115 * to either the container or the contained widget, but rather to their relation.
116 * Typical examples of child properties are the position or pack-type of a widget
117 * which is contained in a GtkBox.
118 * Use gtk_container_class_install_child_property() to install child properties
119 * for a container class and gtk_container_class_find_child_property() or
120 * gtk_container_class_list_child_properties() to get information about existing
121 * child properties.
122 * To set the value of a child property, use gtk_container_child_set_property(),
123 * gtk_container_child_set() or gtk_container_child_set_valist().
124 * To obtain the value of a child property, use
125 * gtk_container_child_get_property(), gtk_container_child_get() or
126 * gtk_container_child_get_valist(). To emit notification about child property
127 * changes, use gtk_widget_child_notify().
129 private import gtk.Widget;
130 public class Container : Widget
133 /** the main Gtk struct */
134 protected GtkContainer* gtkContainer;
137 public GtkContainer* getContainerStruct()
139 return gtkContainer;
143 /** the main Gtk struct as a void* */
144 protected void* getStruct()
146 return cast(void*)gtkContainer;
150 * Sets our main struct and passes it to the parent class
152 public this (GtkContainer* gtkContainer)
154 super(cast(GtkWidget*)gtkContainer);
155 this.gtkContainer = gtkContainer;
159 * Removes all widgets from the container
161 void removeAll()
163 ListG children = new ListG(gtk_container_get_children(getContainerStruct()));
164 for ( int i=children.length()-1 ; i>=0 ; i-- )
166 gtk_container_remove(getContainerStruct(), cast(GtkWidget*)children.nthData(i));
173 // imports for the signal processing
174 private import gobject.Signals;
175 private import gdk.gdktypes;
176 int[char[]] connectedSignals;
178 void delegate(Widget, Container)[] onAddListeners;
179 void addOnAdd(void delegate(Widget, Container) dlg)
181 if ( !("add" in connectedSignals) )
183 Signals.connectData(
184 getStruct(),
185 "add",
186 cast(GCallback)&callBackAdd,
187 this,
188 null,
189 cast(ConnectFlags)0);
190 connectedSignals["add"] = 1;
192 onAddListeners ~= dlg;
194 extern(C) static void callBackAdd(GtkContainer* containerStruct, GtkWidget* widget, Container container)
196 bit consumed = false;
198 foreach ( void delegate(Widget, Container) dlg ; container.onAddListeners )
200 dlg(new Widget(widget), container);
203 return consumed;
206 void delegate(Container)[] onCheckResizeListeners;
207 void addOnCheckResize(void delegate(Container) dlg)
209 if ( !("check-resize" in connectedSignals) )
211 Signals.connectData(
212 getStruct(),
213 "check-resize",
214 cast(GCallback)&callBackCheckResize,
215 this,
216 null,
217 cast(ConnectFlags)0);
218 connectedSignals["check-resize"] = 1;
220 onCheckResizeListeners ~= dlg;
222 extern(C) static void callBackCheckResize(GtkContainer* containerStruct, Container container)
224 bit consumed = false;
226 foreach ( void delegate(Container) dlg ; container.onCheckResizeListeners )
228 dlg(container);
231 return consumed;
234 void delegate(Widget, Container)[] onRemoveListeners;
235 void addOnRemove(void delegate(Widget, Container) dlg)
237 if ( !("remove" in connectedSignals) )
239 Signals.connectData(
240 getStruct(),
241 "remove",
242 cast(GCallback)&callBackRemove,
243 this,
244 null,
245 cast(ConnectFlags)0);
246 connectedSignals["remove"] = 1;
248 onRemoveListeners ~= dlg;
250 extern(C) static void callBackRemove(GtkContainer* containerStruct, GtkWidget* widget, Container container)
252 bit consumed = false;
254 foreach ( void delegate(Widget, Container) dlg ; container.onRemoveListeners )
256 dlg(new Widget(widget), container);
259 return consumed;
262 void delegate(Widget, Container)[] onSetFocusChildListeners;
263 void addOnSetFocusChild(void delegate(Widget, Container) dlg)
265 if ( !("set-focus-child" in connectedSignals) )
267 Signals.connectData(
268 getStruct(),
269 "set-focus-child",
270 cast(GCallback)&callBackSetFocusChild,
271 this,
272 null,
273 cast(ConnectFlags)0);
274 connectedSignals["set-focus-child"] = 1;
276 onSetFocusChildListeners ~= dlg;
278 extern(C) static void callBackSetFocusChild(GtkContainer* containerStruct, GtkWidget* widget, Container container)
280 bit consumed = false;
282 foreach ( void delegate(Widget, Container) dlg ; container.onSetFocusChildListeners )
284 dlg(new Widget(widget), container);
287 return consumed;
296 * Adds widget to container. Typically used for simple containers
297 * such as GtkWindow, GtkFrame, or GtkButton; for more complicated
298 * layout containers such as GtkBox or GtkTable, this function will
299 * pick default packing parameters that may not be correct. So
300 * consider functions such as gtk_box_pack_start() and
301 * gtk_table_attach() as an alternative to gtk_container_add() in
302 * those cases. A widget may be added to only one container at a time;
303 * you can't place the same widget inside two different containers.
304 * container:
305 * a GtkContainer
306 * widget:
307 * a widget to be placed inside container
309 public void add(Widget widget)
311 // void gtk_container_add (GtkContainer *container, GtkWidget *widget);
312 gtk_container_add(gtkContainer, (widget is null) ? null : widget.getWidgetStruct());
316 * Removes widget from container. widget must be inside container.
317 * Note that container will own a reference to widget, and that this
318 * may be the last reference held; so removing a widget from its
319 * container can destroy that widget. If you want to use widget
320 * again, you need to add a reference to it while it's not inside
321 * a container, using g_object_ref(). If you don't want to use widget
322 * again it's usually more efficient to simply destroy it directly
323 * using gtk_widget_destroy() since this will remove it from the
324 * container and help break any circular reference count cycles.
325 * container:
326 * a GtkContainer
327 * widget:
328 * a current child of container
330 public void remove(Widget widget)
332 // void gtk_container_remove (GtkContainer *container, GtkWidget *widget);
333 gtk_container_remove(gtkContainer, (widget is null) ? null : widget.getWidgetStruct());
337 * Adds widget to container, setting child properties at the same time.
338 * See gtk_container_add() and gtk_container_child_set() for more details.
339 * container:
340 * a GtkContainer
341 * widget:
342 * a widget to be placed inside container
343 * first_prop_name:
344 * the name of the first child property to set
345 * ...:
346 * a NULL-terminated list of property names and values, starting
347 * with first_prop_name.
349 public void addWithProperties(Widget widget, char[] firstPropName, ... )
351 // void gtk_container_add_with_properties (GtkContainer *container, GtkWidget *widget, const gchar *first_prop_name, ...);
352 gtk_container_add_with_properties(gtkContainer, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(firstPropName));
356 * Returns the resize mode for the container. See
357 * gtk_container_set_resize_mode().
358 * container:
359 * a GtkContainer
360 * Returns:
361 * the current resize mode
363 public GtkResizeMode getResizeMode()
365 // GtkResizeMode gtk_container_get_resize_mode (GtkContainer *container);
366 return gtk_container_get_resize_mode(gtkContainer);
370 * Sets the resize mode for the container.
371 * The resize mode of a container determines whether a resize request
372 * will be passed to the container's parent, queued for later execution
373 * or executed immediately.
374 * container:
375 * a GtkContainer.
376 * resize_mode:
377 * the new resize mode.
379 public void setResizeMode(GtkResizeMode resizeMode)
381 // void gtk_container_set_resize_mode (GtkContainer *container, GtkResizeMode resize_mode);
382 gtk_container_set_resize_mode(gtkContainer, resizeMode);
386 * container:
388 public void checkResize()
390 // void gtk_container_check_resize (GtkContainer *container);
391 gtk_container_check_resize(gtkContainer);
395 * Invokes callback on each non-internal child of container. See
396 * gtk_container_forall() for details on what constitutes an
397 * "internal" child. Most applications should use
398 * gtk_container_foreach(), rather than gtk_container_forall().
399 * container:
400 * a GtkContainer
401 * callback:
402 * a callback
403 * callback_data:
404 * callback user data
406 public void foreac(GtkCallback callback, void* callbackData)
408 // void gtk_container_foreach (GtkContainer *container, GtkCallback callback, gpointer callback_data);
409 gtk_container_foreach(gtkContainer, callback, callbackData);
413 * Warning
414 * gtk_container_foreach_full is deprecated and should not be used in newly-written code. Use gtk_container_foreach() instead.
415 * container:
416 * callback:
417 * marshal:
418 * callback_data:
419 * notify:
421 public void foreachFull(GtkCallback callback, GtkCallbackMarshal marshal, void* callbackData, GtkDestroyNotify notify)
423 // void gtk_container_foreach_full (GtkContainer *container, GtkCallback callback, GtkCallbackMarshal marshal, gpointer callback_data, GtkDestroyNotify notify);
424 gtk_container_foreach_full(gtkContainer, callback, marshal, callbackData, notify);
429 * Returns the container's non-internal children. See
430 * gtk_container_forall() for details on what constitutes an "internal" child.
431 * container:
432 * a GtkContainer.
433 * Returns:
434 * a newly-allocated list of the container's non-internal children.
436 public ListG getChildren()
438 // GList* gtk_container_get_children (GtkContainer *container);
439 return new ListG( gtk_container_get_children(gtkContainer) );
443 * Sets the reallocate_redraws flag of the container to the given value.
444 * Containers requesting reallocation redraws get automatically
445 * redrawn if any of their children changed allocation.
446 * container:
447 * a GtkContainer.
448 * needs_redraws:
449 * the new value for the container's reallocate_redraws flag.
451 public void setReallocateRedraws(int needsRedraws)
453 // void gtk_container_set_reallocate_redraws (GtkContainer *container, gboolean needs_redraws);
454 gtk_container_set_reallocate_redraws(gtkContainer, needsRedraws);
458 * container:
459 * child:
461 public void setFocusChild(Widget child)
463 // void gtk_container_set_focus_child (GtkContainer *container, GtkWidget *child);
464 gtk_container_set_focus_child(gtkContainer, (child is null) ? null : child.getWidgetStruct());
468 * Retrieves the vertical focus adjustment for the container. See
469 * gtk_container_set_focus_vadjustment().
470 * container:
471 * a GtkContainer
472 * Returns:
473 * the vertical focus adjustment, or NULL if
474 * none has been set.
476 public Adjustment getFocusVadjustment()
478 // GtkAdjustment* gtk_container_get_focus_vadjustment (GtkContainer *container);
479 return new Adjustment( gtk_container_get_focus_vadjustment(gtkContainer) );
483 * Hooks up an adjustment to focus handling in a container, so when a child of the
484 * container is focused, the adjustment is scrolled to show that widget. This function
485 * sets the vertical alignment. See gtk_scrolled_window_get_vadjustment() for a typical
486 * way of obtaining the adjustment and gtk_container_set_focus_hadjustment() for setting
487 * the horizontal adjustment.
488 * The adjustments have to be in pixel units and in the same coordinate system as the
489 * allocation for immediate children of the container.
490 * container:
491 * a GtkContainer
492 * adjustment:
493 * an adjustment which should be adjusted when the focus is moved among the
494 * descendents of container
496 public void setFocusVadjustment(Adjustment adjustment)
498 // void gtk_container_set_focus_vadjustment (GtkContainer *container, GtkAdjustment *adjustment);
499 gtk_container_set_focus_vadjustment(gtkContainer, (adjustment is null) ? null : adjustment.getAdjustmentStruct());
503 * Retrieves the horizontal focus adjustment for the container. See
504 * gtk_container_set_focus_hadjustment().
505 * container:
506 * a GtkContainer
507 * Returns:
508 * the horizontal focus adjustment, or NULL if
509 * none has been set.
511 public Adjustment getFocusHadjustment()
513 // GtkAdjustment* gtk_container_get_focus_hadjustment (GtkContainer *container);
514 return new Adjustment( gtk_container_get_focus_hadjustment(gtkContainer) );
518 * Hooks up an adjustment to focus handling in a container, so when a child of the
519 * container is focused, the adjustment is scrolled to show that widget. This function
520 * sets the horizontal alignment. See gtk_scrolled_window_get_hadjustment() for a typical
521 * way of obtaining the adjustment and gtk_container_set_focus_vadjustment() for setting
522 * the vertical adjustment.
523 * The adjustments have to be in pixel units and in the same coordinate system as the
524 * allocation for immediate children of the container.
525 * container:
526 * a GtkContainer
527 * adjustment:
528 * an adjustment which should be adjusted when the focus is moved among the
529 * descendents of container
531 public void setFocusHadjustment(Adjustment adjustment)
533 // void gtk_container_set_focus_hadjustment (GtkContainer *container, GtkAdjustment *adjustment);
534 gtk_container_set_focus_hadjustment(gtkContainer, (adjustment is null) ? null : adjustment.getAdjustmentStruct());
538 * container:
540 public void resizeChildren()
542 // void gtk_container_resize_children (GtkContainer *container);
543 gtk_container_resize_children(gtkContainer);
547 * Returns the type of the children supported by the container.
548 * Note that this may return G_TYPE_NONE to indicate that no more
549 * children can be added, e.g. for a GtkPaned which already has two
550 * children.
551 * container:
552 * a GtkContainer.
553 * Returns:
554 * a GType.
556 public GType childType()
558 // GType gtk_container_child_type (GtkContainer *container);
559 return gtk_container_child_type(gtkContainer);
563 * Gets the values of one or more child properties for child and container.
564 * container:
565 * a GtkContainer
566 * child:
567 * a widget which is a child of container
568 * first_prop_name:
569 * the name of the first property to get
570 * ...:
571 * a NULL-terminated list of property names and GValue*,
572 * starting with first_prop_name.
574 public void childGet(Widget child, char[] firstPropName, ... )
576 // void gtk_container_child_get (GtkContainer *container, GtkWidget *child, const gchar *first_prop_name, ...);
577 gtk_container_child_get(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(firstPropName));
581 * Sets one or more child properties for child and container.
582 * container:
583 * a GtkContainer
584 * child:
585 * a widget which is a child of container
586 * first_prop_name:
587 * the name of the first property to set
588 * ...:
589 * a NULL-terminated list of property names and values, starting
590 * with first_prop_name.
592 public void childSet(Widget child, char[] firstPropName, ... )
594 // void gtk_container_child_set (GtkContainer *container, GtkWidget *child, const gchar *first_prop_name, ...);
595 gtk_container_child_set(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(firstPropName));
599 * Gets the value of a child property for child and container.
600 * container:
601 * a GtkContainer
602 * child:
603 * a widget which is a child of container
604 * property_name:
605 * the name of the property to get
606 * value:
607 * a location to return the value
609 public void childGetProperty(Widget child, char[] propertyName, Value value)
611 // void gtk_container_child_get_property (GtkContainer *container, GtkWidget *child, const gchar *property_name, GValue *value);
612 gtk_container_child_get_property(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(propertyName), (value is null) ? null : value.getValueStruct());
616 * Sets a child property for child and container.
617 * container:
618 * a GtkContainer
619 * child:
620 * a widget which is a child of container
621 * property_name:
622 * the name of the property to set
623 * value:
624 * the value to set the property to
626 public void childSetProperty(Widget child, char[] propertyName, Value value)
628 // void gtk_container_child_set_property (GtkContainer *container, GtkWidget *child, const gchar *property_name, const GValue *value);
629 gtk_container_child_set_property(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(propertyName), (value is null) ? null : value.getValueStruct());
633 * Gets the values of one or more child properties for child and container.
634 * container:
635 * a GtkContainer
636 * child:
637 * a widget which is a child of container
638 * first_property_name:
639 * the name of the first property to get
640 * var_args:
641 * a NULL-terminated list of property names and GValue*,
642 * starting with first_prop_name.
644 public void childGetValist(Widget child, char[] firstPropertyName, void* varArgs)
646 // void gtk_container_child_get_valist (GtkContainer *container, GtkWidget *child, const gchar *first_property_name, va_list var_args);
647 gtk_container_child_get_valist(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(firstPropertyName), varArgs);
651 * Sets one or more child properties for child and container.
652 * container:
653 * a GtkContainer
654 * child:
655 * a widget which is a child of container
656 * first_property_name:
657 * the name of the first property to set
658 * var_args:
659 * a NULL-terminated list of property names and values, starting
660 * with first_prop_name.
662 public void childSetValist(Widget child, char[] firstPropertyName, void* varArgs)
664 // void gtk_container_child_set_valist (GtkContainer *container, GtkWidget *child, const gchar *first_property_name, va_list var_args);
665 gtk_container_child_set_valist(gtkContainer, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(firstPropertyName), varArgs);
669 * Invokes callback on each child of container, including children
670 * that are considered "internal" (implementation details of the
671 * container). "Internal" children generally weren't added by the user
672 * of the container, but were added by the container implementation
673 * itself. Most applications should use gtk_container_foreach(),
674 * rather than gtk_container_forall().
675 * container:
676 * a GtkContainer
677 * callback:
678 * a callback
679 * callback_data:
680 * callback user data
682 public void forall(GtkCallback callback, void* callbackData)
684 // void gtk_container_forall (GtkContainer *container, GtkCallback callback, gpointer callback_data);
685 gtk_container_forall(gtkContainer, callback, callbackData);
689 * Retrieves the border width of the container. See
690 * gtk_container_set_border_width().
691 * container:
692 * a GtkContainer
693 * Returns:
694 * the current border width
696 public uint getBorderWidth()
698 // guint gtk_container_get_border_width (GtkContainer *container);
699 return gtk_container_get_border_width(gtkContainer);
703 * Sets the border width of the container.
704 * The border width of a container is the amount of space to leave
705 * around the outside of the container. The only exception to this is
706 * GtkWindow; because toplevel windows can't leave space outside,
707 * they leave the space inside. The border is added on all sides of
708 * the container. To add space to only one side, one approach is to
709 * create a GtkAlignment widget, call gtk_widget_set_usize() to give
710 * it a size, and place it on the side of the container as a spacer.
711 * container:
712 * a GtkContainer
713 * border_width:
714 * amount of blank space to leave outside the container.
715 * Valid values are in the range 0-65535 pixels.
717 public void setBorderWidth(uint borderWidth)
719 // void gtk_container_set_border_width (GtkContainer *container, guint border_width);
720 gtk_container_set_border_width(gtkContainer, borderWidth);
724 * When a container receives an expose event, it must send synthetic
725 * expose events to all children that don't have their own GdkWindows.
726 * This function provides a convenient way of doing this. A container,
727 * when it receives an expose event, calls gtk_container_propagate_expose()
728 * once for each child, passing in the event the container received.
729 * gtk_container_propagate_expose() takes care of deciding whether
730 * an expose event needs to be sent to the child, intersecting
731 * the event's area with the child area, and sending the event.
732 * In most cases, a container can simply either simply inherit the
733 * ::expose implementation from GtkContainer, or, do some drawing
734 * and then chain to the ::expose implementation from GtkContainer.
735 * container:
736 * a GtkContainer
737 * child:
738 * a child of container
739 * event:
740 * a expose event sent to container
742 public void propagateExpose(Widget child, GdkEventExpose* event)
744 // void gtk_container_propagate_expose (GtkContainer *container, GtkWidget *child, GdkEventExpose *event);
745 gtk_container_propagate_expose(gtkContainer, (child is null) ? null : child.getWidgetStruct(), event);
749 * Retrieves the focus chain of the container, if one has been
750 * set explicitly. If no focus chain has been explicitly
751 * set, GTK+ computes the focus chain based on the positions
752 * of the children. In that case, GTK+ stores NULL in
753 * focusable_widgets and returns FALSE.
754 * container:
755 * a GtkContainer
756 * focusable_widgets:
757 * location to store the focus chain of the
758 * container, or NULL. You should free this list
759 * using g_list_free() when you are done with it, however
760 * no additional reference count is added to the
761 * individual widgets in the focus chain.
762 * Returns:
763 * TRUE if the focus chain of the container
764 * has been set explicitly.
766 public int getFocusChain(GList** focusableWidgets)
768 // gboolean gtk_container_get_focus_chain (GtkContainer *container, GList **focusable_widgets);
769 return gtk_container_get_focus_chain(gtkContainer, focusableWidgets);
773 * Sets a focus chain, overriding the one computed automatically by GTK+.
774 * In principle each widget in the chain should be a descendant of the
775 * container, but this is not enforced by this method, since it's allowed
776 * to set the focus chain before you pack the widgets, or have a widget
777 * in the chain that isn't always packed. The necessary checks are done
778 * when the focus chain is actually traversed.
779 * container:
780 * a GtkContainer.
781 * focusable_widgets:
782 * the new focus chain.
784 public void setFocusChain(ListG focusableWidgets)
786 // void gtk_container_set_focus_chain (GtkContainer *container, GList *focusable_widgets);
787 gtk_container_set_focus_chain(gtkContainer, (focusableWidgets is null) ? null : focusableWidgets.getListGStruct());
791 * Removes a focus chain explicitly set with gtk_container_set_focus_chain().
792 * container:
793 * a GtkContainer.
795 public void unsetFocusChain()
797 // void gtk_container_unset_focus_chain (GtkContainer *container);
798 gtk_container_unset_focus_chain(gtkContainer);
802 * Finds a child property of a container class by name.
803 * cclass:
804 * a GtkContainerClass
805 * property_name:
806 * the name of the child property to find
807 * Returns:
808 * the GParamSpec of the child property or NULL if class has no
809 * child property with that name.
811 public static GParamSpec* classFindChildProperty(GObjectClass* cclass, char[] propertyName)
813 // GParamSpec* gtk_container_class_find_child_property (GObjectClass *cclass, const gchar *property_name);
814 return gtk_container_class_find_child_property(cclass, Str.toStringz(propertyName));
818 * Installs a child property on a container class.
819 * cclass:
820 * a GtkContainerClass
821 * property_id:
822 * the id for the property
823 * pspec:
824 * the GParamSpec for the property
826 public static void classInstallChildProperty(Container cclass, uint propertyId, GParamSpec* pspec)
828 // void gtk_container_class_install_child_property (GtkContainerClass *cclass, guint property_id, GParamSpec *pspec);
829 gtk_container_class_install_child_property((cclass is null) ? null : cclass.getContainerStruct(), propertyId, pspec);
833 * Returns all child properties of a container class.
834 * cclass:
835 * a GtkContainerClass
836 * n_properties:
837 * location to return the number of child properties found
838 * Returns:
839 * a newly allocated array of GParamSpec*. The array must be
840 * freed with g_free().
841 * Property Details
842 * The "border-width" property
843 * "border-width" guint : Read / Write
844 * The width of the empty border outside the containers children.
845 * Allowed values: <= G_MAXINT
846 * Default value: 0
848 public static GParamSpec** classListChildProperties(GObjectClass* cclass, uint* nProperties)
850 // GParamSpec** gtk_container_class_list_child_properties (GObjectClass *cclass, guint *n_properties);
851 return gtk_container_class_list_child_properties(cclass, nProperties);