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 = GtkToolbar.html
44 * - gtk_toolbar_get_style
51 * - GtkWidget* -> Widget
57 private import gtk
.gtktypes
;
59 private import lib
.gtk
;
61 private import glib
.Str
;
62 private import gtk
.Widget
;
63 private import gtk
.Button
;
64 private import gtk
.ToolItem
;
68 * A toolbar is created with a call to gtk_toolbar_new().
69 * A toolbar can contain instances of a subclass of GtkToolItem. To add
70 * a GtkToolItem to the a toolbar, use gtk_toolbar_insert(). To remove
71 * an item from the toolbar use gtk_container_remove(). To add a button
72 * to the toolbar, add an instance of GtkToolButton.
73 * Toolbar items can be visually grouped by adding instances of
74 * GtkSeparatorToolItem to the toolbar. If a GtkSeparatorToolItem has
75 * the "expand" property set to TRUE and the "draw" property set to
76 * FALSE the effect is to force all following items to the end of the
78 * Creating a context menu for the toolbar can be done by connecting to
79 * the GtkToolbar::popup-context-menu signal.
81 private import gtk
.Container
;
82 public class Toolbar
: Container
85 /** the main Gtk struct */
86 protected GtkToolbar
* gtkToolbar
;
89 public GtkToolbar
* getToolbarStruct()
95 /** the main Gtk struct as a void* */
96 protected void* getStruct()
98 return cast(void*)gtkToolbar
;
102 * Sets our main struct and passes it to the parent class
104 public this (GtkToolbar
* gtkToolbar
)
106 super(cast(GtkContainer
*)gtkToolbar
);
107 this.gtkToolbar
= gtkToolbar
;
111 * Retrieves whether the toolbar has text, icons, or both . See
112 * gtk_toolbar_set_style().
116 * the current style of toolbar
118 public GtkToolbarStyle
toolbarGetStyle()
120 // GtkToolbarStyle gtk_toolbar_get_style (GtkToolbar *toolbar);
121 return gtk_toolbar_get_style(gtkToolbar
);
124 public void insert (ToolItem toolItem
, int pos
=-1)
126 gtk_toolbar_insert(gtkToolbar
, toolItem
.getToolItemStruct(), pos
);
129 public Widget
insertStock(StockID stockId
, char[] tooltipText
, char[] tooltipPrivateText
, GtkSignalFunc callback
, void* userData
, int position
)
131 return insertStock(getId(stockId
), tooltipText
, tooltipPrivateText
, callback
, userData
, position
);
134 public Widget
insertStock(char[] stockId
, char[] tooltipText
, char[] tooltipPrivateText
, int position
)
136 return insertStock(stockId
, tooltipText
, tooltipPrivateText
, null, null, position
);
139 public Widget
insertStock(StockID stockId
, char[] tooltipText
, char[] tooltipPrivateText
, int position
)
141 return insertStock(getId(stockId
), tooltipText
, tooltipPrivateText
, null, null, position
);
144 Button
insertButton(StockID stockID
,
145 char[] tooltipText
, char[] tooltipPrivateText
,
148 Button button
= new Button(
149 cast(GtkButton
*)gtk_toolbar_insert_stock(
151 Str
.toStringz(StockDesc
[stockID
]),
152 Str
.toStringz(tooltipText
),
153 Str
.toStringz(tooltipPrivateText
),
163 // imports for the signal processing
164 private import gobject
.Signals
;
165 private import gdk
.gdktypes
;
166 int[char[]] connectedSignals
;
168 gboolean
delegate(gboolean
, Toolbar
)[] onFocusHomeOrEndListeners
;
169 void addOnFocusHomeOrEnd(gboolean
delegate(gboolean
, Toolbar
) dlg
)
171 if ( !("focus-home-or-end" in connectedSignals
) )
176 cast(GCallback
)&callBackFocusHomeOrEnd
,
179 cast(ConnectFlags
)0);
180 connectedSignals
["focus-home-or-end"] = 1;
182 onFocusHomeOrEndListeners
~= dlg
;
184 extern(C
) static void callBackFocusHomeOrEnd(GtkToolbar
* toolbarStruct
, gboolean focusHome
, Toolbar toolbar
)
186 bit consumed
= false;
188 foreach ( gboolean
delegate(gboolean
, Toolbar
) dlg
; toolbar
.onFocusHomeOrEndListeners
)
190 dlg(focusHome
, toolbar
);
196 gboolean
delegate(GtkDirectionType
, Toolbar
)[] onMoveFocusListeners
;
197 void addOnMoveFocus(gboolean
delegate(GtkDirectionType
, Toolbar
) dlg
)
199 if ( !("move-focus" in connectedSignals
) )
204 cast(GCallback
)&callBackMoveFocus
,
207 cast(ConnectFlags
)0);
208 connectedSignals
["move-focus"] = 1;
210 onMoveFocusListeners
~= dlg
;
212 extern(C
) static void callBackMoveFocus(GtkToolbar
* toolbarStruct
, GtkDirectionType dir
, Toolbar toolbar
)
214 bit consumed
= false;
216 foreach ( gboolean
delegate(GtkDirectionType
, Toolbar
) dlg
; toolbar
.onMoveFocusListeners
)
224 void delegate(GtkOrientation
, Toolbar
)[] onOrientationChangedListeners
;
225 void addOnOrientationChanged(void delegate(GtkOrientation
, Toolbar
) dlg
)
227 if ( !("orientation-changed" in connectedSignals
) )
231 "orientation-changed",
232 cast(GCallback
)&callBackOrientationChanged
,
235 cast(ConnectFlags
)0);
236 connectedSignals
["orientation-changed"] = 1;
238 onOrientationChangedListeners
~= dlg
;
240 extern(C
) static void callBackOrientationChanged(GtkToolbar
* toolbarStruct
, GtkOrientation orientation
, Toolbar toolbar
)
242 bit consumed
= false;
244 foreach ( void delegate(GtkOrientation
, Toolbar
) dlg
; toolbar
.onOrientationChangedListeners
)
246 dlg(orientation
, toolbar
);
252 gboolean
delegate(gint
, gint
, gint
, Toolbar
)[] onPopupContextMenuListeners
;
253 void addOnPopupContextMenu(gboolean
delegate(gint
, gint
, gint
, Toolbar
) dlg
)
255 if ( !("popup-context-menu" in connectedSignals
) )
259 "popup-context-menu",
260 cast(GCallback
)&callBackPopupContextMenu
,
263 cast(ConnectFlags
)0);
264 connectedSignals
["popup-context-menu"] = 1;
266 onPopupContextMenuListeners
~= dlg
;
268 extern(C
) static void callBackPopupContextMenu(GtkToolbar
* toolbarStruct
, gint x
, gint y
, gint button
, Toolbar toolbar
)
270 bit consumed
= false;
272 foreach ( gboolean
delegate(gint
, gint
, gint
, Toolbar
) dlg
; toolbar
.onPopupContextMenuListeners
)
274 dlg(x
, y
, button
, toolbar
);
280 void delegate(GtkToolbarStyle
, Toolbar
)[] onStyleChangedListeners
;
281 void addOnStyleChanged(void delegate(GtkToolbarStyle
, Toolbar
) dlg
)
283 if ( !("style-changed" in connectedSignals
) )
288 cast(GCallback
)&callBackStyleChanged
,
291 cast(ConnectFlags
)0);
292 connectedSignals
["style-changed"] = 1;
294 onStyleChangedListeners
~= dlg
;
296 extern(C
) static void callBackStyleChanged(GtkToolbar
* toolbarStruct
, GtkToolbarStyle style
, Toolbar toolbar
)
298 bit consumed
= false;
300 foreach ( void delegate(GtkToolbarStyle
, Toolbar
) dlg
; toolbar
.onStyleChangedListeners
)
314 * Creates a new toolbar.
316 * the newly-created toolbar.
320 // GtkWidget* gtk_toolbar_new (void);
321 this(cast(GtkToolbar
*)gtk_toolbar_new() );
325 * Insert a GtkToolItem into the toolbar at position pos. If pos is
326 * 0 the item is prepended to the start of the toolbar. If pos is
327 * negative, the item is appended to the end of the toolbar.
333 * the position of the new item
336 public void insert(GtkToolItem
* item
, int pos
)
338 // void gtk_toolbar_insert (GtkToolbar *toolbar, GtkToolItem *item, gint pos);
339 gtk_toolbar_insert(gtkToolbar
, item
, pos
);
343 * Returns the position of item on the toolbar, starting from 0.
344 * It is an error if item is not a child of the toolbar.
348 * a GtkToolItem that is a child of toolbar
350 * the position of item on the toolbar.
353 public int getItemIndex(GtkToolItem
* item
)
355 // gint gtk_toolbar_get_item_index (GtkToolbar *toolbar, GtkToolItem *item);
356 return gtk_toolbar_get_item_index(gtkToolbar
, item
);
360 * Returns the number of items on the toolbar.
364 * the number of items on the toolbar
367 public int getNItems()
369 // gint gtk_toolbar_get_n_items (GtkToolbar *toolbar);
370 return gtk_toolbar_get_n_items(gtkToolbar
);
374 * Returns the n'th item on toolbar, or NULL if the
375 * toolbar does not contain an n'th item.
379 * A position on the toolbar
381 * The n'th GtkToolItem on toolbar, or NULL if there
382 * isn't an n'th item.
385 public GtkToolItem
* getNthItem(int n
)
387 // GtkToolItem* gtk_toolbar_get_nth_item (GtkToolbar *toolbar, gint n);
388 return gtk_toolbar_get_nth_item(gtkToolbar
, n
);
392 * Returns the position corresponding to the indicated point on
393 * toolbar. This is useful when dragging items to the toolbar:
394 * this function returns the position a new item should be
396 * x and y are in toolbar coordinates.
400 * x coordinate of a point on the toolbar
402 * y coordinate of a point on the toolbar
404 * The position corresponding to the point (x, y) on the toolbar.
407 public int getDropIndex(int x
, int y
)
409 // gint gtk_toolbar_get_drop_index (GtkToolbar *toolbar, gint x, gint y);
410 return gtk_toolbar_get_drop_index(gtkToolbar
, x
, y
);
414 * Highlights toolbar to give an idea of what it would look like
415 * if item was added to toolbar at the position indicated by index_.
416 * If item is NULL, highlighting is turned off. In that case index_
418 * The tool_item passed to this function must not be part of any widget
419 * hierarchy. When an item is set as drop highlight item it can not
420 * added to any widget hierarchy or used as highlight item for another
425 * a GtkToolItem, or NULL to turn of highlighting
427 * a position on toolbar
430 public void setDropHighlightItem(GtkToolItem
* toolItem
, int index
)
432 // void gtk_toolbar_set_drop_highlight_item (GtkToolbar *toolbar, GtkToolItem *tool_item, gint index_);
433 gtk_toolbar_set_drop_highlight_item(gtkToolbar
, toolItem
, index
);
437 * Sets whether to show an overflow menu when
438 * toolbar doesn't have room for all items on it. If TRUE,
439 * items that there are not room are available through an
444 * Whether to show an overflow menu
447 public void setShowArrow(int showArrow
)
449 // void gtk_toolbar_set_show_arrow (GtkToolbar *toolbar, gboolean show_arrow);
450 gtk_toolbar_set_show_arrow(gtkToolbar
, showArrow
);
454 * Sets whether a toolbar should appear horizontally or vertically.
458 * a new GtkOrientation.
460 public void setOrientation(GtkOrientation orientation
)
462 // void gtk_toolbar_set_orientation (GtkToolbar *toolbar, GtkOrientation orientation);
463 gtk_toolbar_set_orientation(gtkToolbar
, orientation
);
467 * Sets if the tooltips of a toolbar should be active or not.
471 * set to FALSE to disable the tooltips, or TRUE to enable them.
473 public void setTooltips(int enable
)
475 // void gtk_toolbar_set_tooltips (GtkToolbar *toolbar, gboolean enable);
476 gtk_toolbar_set_tooltips(gtkToolbar
, enable
);
481 * gtk_toolbar_unset_icon_size is deprecated and should not be used in newly-written code.
482 * Unsets toolbar icon size set with gtk_toolbar_set_icon_size(), so that
483 * user preferences will be used to determine the icon size.
487 public void unsetIconSize()
489 // void gtk_toolbar_unset_icon_size (GtkToolbar *toolbar);
490 gtk_toolbar_unset_icon_size(gtkToolbar
);
494 * Returns whether the toolbar has an overflow menu.
495 * See gtk_toolbar_set_show_arrow().
499 * TRUE if the toolbar has an overflow menu.
502 public int getShowArrow()
504 // gboolean gtk_toolbar_get_show_arrow (GtkToolbar *toolbar);
505 return gtk_toolbar_get_show_arrow(gtkToolbar
);
509 * Retrieves the current orientation of the toolbar. See
510 * gtk_toolbar_set_orientation().
516 public GtkOrientation
getOrientation()
518 // GtkOrientation gtk_toolbar_get_orientation (GtkToolbar *toolbar);
519 return gtk_toolbar_get_orientation(gtkToolbar
);
524 * Retrieves the icon size for the toolbar. See gtk_toolbar_set_icon_size().
528 * the current icon size for the icons on the toolbar.
530 public GtkIconSize
getIconSize()
532 // GtkIconSize gtk_toolbar_get_icon_size (GtkToolbar *toolbar);
533 return gtk_toolbar_get_icon_size(gtkToolbar
);
537 * Retrieves whether tooltips are enabled. See
538 * gtk_toolbar_set_tooltips().
542 * TRUE if tooltips are enabled
544 public int getTooltips()
546 // gboolean gtk_toolbar_get_tooltips (GtkToolbar *toolbar);
547 return gtk_toolbar_get_tooltips(gtkToolbar
);
551 * Returns the relief style of buttons on toolbar. See
552 * gtk_button_set_relief().
556 * The relief style of buttons on toolbar.
559 public GtkReliefStyle
getReliefStyle()
561 // GtkReliefStyle gtk_toolbar_get_relief_style (GtkToolbar *toolbar);
562 return gtk_toolbar_get_relief_style(gtkToolbar
);
567 * gtk_toolbar_append_item is deprecated and should not be used in newly-written code.
568 * Inserts a new item into the toolbar. You must specify the position
569 * in the toolbar where it will be inserted.
570 * callback must be a pointer to a function taking a GtkWidget and a gpointer as
571 * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to GtkSignalFunc.
575 * give your toolbar button a label.
577 * a string that appears when the user holds the mouse over this item.
578 * tooltip_private_text:
579 * use with GtkTipsQuery.
581 * a GtkWidget that should be used as the button's icon.
583 * the function to be executed when the button is pressed.
585 * a pointer to any data you wish to be passed to the callback.
587 * the new toolbar item as a GtkWidget.
589 public Widget
appendItem(char[] text
, char[] tooltipText
, char[] tooltipPrivateText
, Widget icon
, GtkSignalFunc callback
, void* userData
)
591 // GtkWidget* gtk_toolbar_append_item (GtkToolbar *toolbar, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data);
592 return new Widget( gtk_toolbar_append_item(gtkToolbar
, Str
.toStringz(text
), Str
.toStringz(tooltipText
), Str
.toStringz(tooltipPrivateText
), (icon
is null) ?
null : icon
.getWidgetStruct(), callback
, userData
) );
597 * gtk_toolbar_prepend_item is deprecated and should not be used in newly-written code.
598 * Adds a new button to the beginning (top or left edges) of the given toolbar.
599 * callback must be a pointer to a function taking a GtkWidget and a gpointer as
600 * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to GtkSignalFunc.
604 * give your toolbar button a label.
606 * a string that appears when the user holds the mouse over this item.
607 * tooltip_private_text:
608 * use with GtkTipsQuery.
610 * a GtkWidget that should be used as the button's icon.
612 * the function to be executed when the button is pressed.
614 * a pointer to any data you wish to be passed to the callback.
616 * the new toolbar item as a GtkWidget.
618 public Widget
prependItem(char[] text
, char[] tooltipText
, char[] tooltipPrivateText
, Widget icon
, GtkSignalFunc callback
, void* userData
)
620 // GtkWidget* gtk_toolbar_prepend_item (GtkToolbar *toolbar, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data);
621 return new Widget( gtk_toolbar_prepend_item(gtkToolbar
, Str
.toStringz(text
), Str
.toStringz(tooltipText
), Str
.toStringz(tooltipPrivateText
), (icon
is null) ?
null : icon
.getWidgetStruct(), callback
, userData
) );
626 * gtk_toolbar_insert_item is deprecated and should not be used in newly-written code.
627 * Inserts a new item into the toolbar. You must specify the position in the
628 * toolbar where it will be inserted.
629 * callback must be a pointer to a function taking a GtkWidget and a gpointer as
630 * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to GtkSignalFunc.
634 * give your toolbar button a label.
636 * a string that appears when the user holds the mouse over this item.
637 * tooltip_private_text:
638 * use with GtkTipsQuery.
640 * a GtkWidget that should be used as the button's icon.
642 * the function to be executed when the button is pressed.
644 * a pointer to any data you wish to be passed to the callback.
646 * the number of widgets to insert this item after.
648 * the new toolbar item as a GtkWidget.
650 public Widget
insertItem(char[] text
, char[] tooltipText
, char[] tooltipPrivateText
, Widget icon
, GtkSignalFunc callback
, void* userData
, int position
)
652 // GtkWidget* gtk_toolbar_insert_item (GtkToolbar *toolbar, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data, gint position);
653 return new Widget( gtk_toolbar_insert_item(gtkToolbar
, Str
.toStringz(text
), Str
.toStringz(tooltipText
), Str
.toStringz(tooltipPrivateText
), (icon
is null) ?
null : icon
.getWidgetStruct(), callback
, userData
, position
) );
658 * gtk_toolbar_append_space is deprecated and should not be used in newly-written code.
659 * Adds a new space to the end of the toolbar.
663 public void appendSpace()
665 // void gtk_toolbar_append_space (GtkToolbar *toolbar);
666 gtk_toolbar_append_space(gtkToolbar
);
671 * gtk_toolbar_prepend_space is deprecated and should not be used in newly-written code.
672 * Adds a new space to the beginning of the toolbar.
676 public void prependSpace()
678 // void gtk_toolbar_prepend_space (GtkToolbar *toolbar);
679 gtk_toolbar_prepend_space(gtkToolbar
);
684 * gtk_toolbar_insert_space is deprecated and should not be used in newly-written code.
685 * Inserts a new space in the toolbar at the specified position.
689 * the number of widgets after which a space should be inserted.
691 public void insertSpace(int position
)
693 // void gtk_toolbar_insert_space (GtkToolbar *toolbar, gint position);
694 gtk_toolbar_insert_space(gtkToolbar
, position
);
699 * gtk_toolbar_append_element is deprecated and should not be used in newly-written code.
700 * Adds a new element to the end of a toolbar.
701 * If type == GTK_TOOLBAR_CHILD_WIDGET, widget is used as the new element.
702 * If type == GTK_TOOLBAR_CHILD_RADIOBUTTON, widget is used to determine
703 * the radio group for the new element. In all other cases, widget must
705 * callback must be a pointer to a function taking a GtkWidget and a gpointer as
706 * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to GtkSignalFunc.
710 * a value of type GtkToolbarChildType that determines what widget will be.
712 * a GtkWidget, or NULL.
714 * the element's label.
716 * the element's tooltip.
717 * tooltip_private_text:
718 * used for context-sensitive help about this toolbar element.
720 * a GtkWidget that provides pictorial representation of the element's function.
722 * the function to be executed when the button is pressed.
724 * any data you wish to pass to the callback.
726 * the new toolbar element as a GtkWidget.
728 public Widget
appendElement(GtkToolbarChildType type
, Widget widget
, char[] text
, char[] tooltipText
, char[] tooltipPrivateText
, Widget icon
, GtkSignalFunc callback
, void* userData
)
730 // GtkWidget* gtk_toolbar_append_element (GtkToolbar *toolbar, GtkToolbarChildType type, GtkWidget *widget, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data);
731 return new Widget( gtk_toolbar_append_element(gtkToolbar
, type
, (widget
is null) ?
null : widget
.getWidgetStruct(), Str
.toStringz(text
), Str
.toStringz(tooltipText
), Str
.toStringz(tooltipPrivateText
), (icon
is null) ?
null : icon
.getWidgetStruct(), callback
, userData
) );
736 * gtk_toolbar_prepend_element is deprecated and should not be used in newly-written code.
737 * Adds a new element to the beginning of a toolbar.
738 * If type == GTK_TOOLBAR_CHILD_WIDGET, widget is used as the new element.
739 * If type == GTK_TOOLBAR_CHILD_RADIOBUTTON, widget is used to determine
740 * the radio group for the new element. In all other cases, widget must
742 * callback must be a pointer to a function taking a GtkWidget and a gpointer as
743 * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to GtkSignalFunc.
747 * a value of type GtkToolbarChildType that determines what widget will be.
749 * a GtkWidget, or NULL
751 * the element's label.
753 * the element's tooltip.
754 * tooltip_private_text:
755 * used for context-sensitive help about this toolbar element.
757 * a GtkWidget that provides pictorial representation of the element's function.
759 * the function to be executed when the button is pressed.
761 * any data you wish to pass to the callback.
763 * the new toolbar element as a GtkWidget.
765 public Widget
prependElement(GtkToolbarChildType type
, Widget widget
, char[] text
, char[] tooltipText
, char[] tooltipPrivateText
, Widget icon
, GtkSignalFunc callback
, void* userData
)
767 // GtkWidget* gtk_toolbar_prepend_element (GtkToolbar *toolbar, GtkToolbarChildType type, GtkWidget *widget, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data);
768 return new Widget( gtk_toolbar_prepend_element(gtkToolbar
, type
, (widget
is null) ?
null : widget
.getWidgetStruct(), Str
.toStringz(text
), Str
.toStringz(tooltipText
), Str
.toStringz(tooltipPrivateText
), (icon
is null) ?
null : icon
.getWidgetStruct(), callback
, userData
) );
773 * gtk_toolbar_insert_element is deprecated and should not be used in newly-written code.
774 * Inserts a new element in the toolbar at the given position.
775 * If type == GTK_TOOLBAR_CHILD_WIDGET, widget is used as the new element.
776 * If type == GTK_TOOLBAR_CHILD_RADIOBUTTON, widget is used to determine
777 * the radio group for the new element. In all other cases, widget must
779 * callback must be a pointer to a function taking a GtkWidget and a gpointer as
780 * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to GtkSignalFunc.
784 * a value of type GtkToolbarChildType that determines what widget
787 * a GtkWidget, or NULL.
789 * the element's label.
791 * the element's tooltip.
792 * tooltip_private_text:
793 * used for context-sensitive help about this toolbar element.
795 * a GtkWidget that provides pictorial representation of the element's function.
797 * the function to be executed when the button is pressed.
799 * any data you wish to pass to the callback.
801 * the number of widgets to insert this element after.
803 * the new toolbar element as a GtkWidget.
805 public Widget
insertElement(GtkToolbarChildType type
, Widget widget
, char[] text
, char[] tooltipText
, char[] tooltipPrivateText
, Widget icon
, GtkSignalFunc callback
, void* userData
, int position
)
807 // GtkWidget* gtk_toolbar_insert_element (GtkToolbar *toolbar, GtkToolbarChildType type, GtkWidget *widget, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data, gint position);
808 return new Widget( gtk_toolbar_insert_element(gtkToolbar
, type
, (widget
is null) ?
null : widget
.getWidgetStruct(), Str
.toStringz(text
), Str
.toStringz(tooltipText
), Str
.toStringz(tooltipPrivateText
), (icon
is null) ?
null : icon
.getWidgetStruct(), callback
, userData
, position
) );
813 * gtk_toolbar_append_widget is deprecated and should not be used in newly-written code.
814 * Adds a widget to the end of the given toolbar.
818 * a GtkWidget to add to the toolbar.
820 * the element's tooltip.
821 * tooltip_private_text:
822 * used for context-sensitive help about this toolbar element.
824 public void appendWidget(Widget widget
, char[] tooltipText
, char[] tooltipPrivateText
)
826 // void gtk_toolbar_append_widget (GtkToolbar *toolbar, GtkWidget *widget, const char *tooltip_text, const char *tooltip_private_text);
827 gtk_toolbar_append_widget(gtkToolbar
, (widget
is null) ?
null : widget
.getWidgetStruct(), Str
.toStringz(tooltipText
), Str
.toStringz(tooltipPrivateText
));
832 * gtk_toolbar_prepend_widget is deprecated and should not be used in newly-written code.
833 * Adds a widget to the beginning of the given toolbar.
837 * a GtkWidget to add to the toolbar.
839 * the element's tooltip.
840 * tooltip_private_text:
841 * used for context-sensitive help about this toolbar element.
843 public void prependWidget(Widget widget
, char[] tooltipText
, char[] tooltipPrivateText
)
845 // void gtk_toolbar_prepend_widget (GtkToolbar *toolbar, GtkWidget *widget, const char *tooltip_text, const char *tooltip_private_text);
846 gtk_toolbar_prepend_widget(gtkToolbar
, (widget
is null) ?
null : widget
.getWidgetStruct(), Str
.toStringz(tooltipText
), Str
.toStringz(tooltipPrivateText
));
851 * gtk_toolbar_insert_widget is deprecated and should not be used in newly-written code.
852 * Inserts a widget in the toolbar at the given position.
856 * a GtkWidget to add to the toolbar.
858 * the element's tooltip.
859 * tooltip_private_text:
860 * used for context-sensitive help about this toolbar element.
862 * the number of widgets to insert this widget after.
864 public void insertWidget(Widget widget
, char[] tooltipText
, char[] tooltipPrivateText
, int position
)
866 // void gtk_toolbar_insert_widget (GtkToolbar *toolbar, GtkWidget *widget, const char *tooltip_text, const char *tooltip_private_text, gint position);
867 gtk_toolbar_insert_widget(gtkToolbar
, (widget
is null) ?
null : widget
.getWidgetStruct(), Str
.toStringz(tooltipText
), Str
.toStringz(tooltipPrivateText
), position
);
871 * Alters the view of toolbar to display either icons only, text only, or both.
875 * the new style for toolbar.
877 public void setStyle(GtkToolbarStyle style
)
879 // void gtk_toolbar_set_style (GtkToolbar *toolbar, GtkToolbarStyle style);
880 gtk_toolbar_set_style(gtkToolbar
, style
);
885 * gtk_toolbar_insert_stock is deprecated and should not be used in newly-written code.
886 * Inserts a stock item at the specified position of the toolbar. If
887 * stock_id is not a known stock item ID, it's inserted verbatim,
888 * except that underscores used to mark mnemonics are removed.
889 * callback must be a pointer to a function taking a GtkWidget and a gpointer as
890 * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to GtkSignalFunc.
894 * The id of the stock item you want to insert
896 * The text in the tooltip of the toolbar button
897 * tooltip_private_text:
898 * The private text of the tooltip
900 * The callback called when the toolbar button is clicked.
902 * user data passed to callback
904 * The position the button shall be inserted at.
905 * -1 means at the end.
907 * the inserted widget
909 public Widget
insertStock(char[] stockId
, char[] tooltipText
, char[] tooltipPrivateText
, GtkSignalFunc callback
, void* userData
, int position
)
911 // GtkWidget* gtk_toolbar_insert_stock (GtkToolbar *toolbar, const gchar *stock_id, const char *tooltip_text, const char *tooltip_private_text, GtkSignalFunc callback, gpointer user_data, gint position);
912 return new Widget( gtk_toolbar_insert_stock(gtkToolbar
, Str
.toStringz(stockId
), Str
.toStringz(tooltipText
), Str
.toStringz(tooltipPrivateText
), callback
, userData
, position
) );
917 * gtk_toolbar_set_icon_size is deprecated and should not be used in newly-written code.
918 * This function sets the size of stock icons in the toolbar. You
919 * can call it both before you add the icons and after they've been
920 * added. The size you set will override user preferences for the default
922 * This should only be used for special-purpose toolbars, normal
923 * application toolbars should respect the user preferences for the
928 * The GtkIconSize that stock icons in the toolbar shall have.
930 public void setIconSize(GtkIconSize iconSize
)
932 // void gtk_toolbar_set_icon_size (GtkToolbar *toolbar, GtkIconSize icon_size);
933 gtk_toolbar_set_icon_size(gtkToolbar
, iconSize
);
938 * gtk_toolbar_remove_space is deprecated and should not be used in newly-written code.
939 * Removes a space from the specified position.
943 * the index of the space to remove.
945 public void removeSpace(int position
)
947 // void gtk_toolbar_remove_space (GtkToolbar *toolbar, gint position);
948 gtk_toolbar_remove_space(gtkToolbar
, position
);
952 * Unsets a toolbar style set with gtk_toolbar_set_style(), so that
953 * user preferences will be used to determine the toolbar style.
957 * The "icon-size" property
958 * "icon-size" GtkIconSize : Read / Write
959 * The size of the icons in a toolbar is normally determined by
960 * the toolbar-icon-size setting. When this property is set, it
961 * overrides the setting.
962 * This should only be used for special-purpose toolbars, normal
963 * application toolbars should respect the user preferences for the
965 * Default value: GTK_ICON_SIZE_LARGE_TOOLBAR
968 public void unsetStyle()
970 // void gtk_toolbar_unset_style (GtkToolbar *toolbar);
971 gtk_toolbar_unset_style(gtkToolbar
);