I've no idea here...
[gtkD.git] / src / gtk / Toolbar.d
blob1698b555d9ebbe3a2464218fc836c7abe5b8f4c7
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 = GtkToolbar.html
26 * outPack = gtk
27 * outFile = Toolbar
28 * strct = GtkToolbar
29 * realStrct=
30 * ctorStrct=
31 * clss = Toolbar
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_toolbar_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * - gtk_toolbar_get_style
45 * imports:
46 * - glib.Str
47 * - gtk.Widget
48 * - gtk.Button
49 * - gtk.ToolItem
50 * structWrap:
51 * - GtkWidget* -> Widget
52 * local aliases:
55 module gtk.Toolbar;
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;
66 /**
67 * Description
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
77 * toolbar.
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()
91 return gtkToolbar;
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().
113 * toolbar:
114 * a GtkToolbar
115 * Returns:
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,
146 gint position)
148 Button button = new Button(
149 cast(GtkButton*)gtk_toolbar_insert_stock(
150 gtkToolbar,
151 Str.toStringz(StockDesc[stockID]),
152 Str.toStringz(tooltipText),
153 Str.toStringz(tooltipPrivateText),
154 null, null,
155 position)
157 return button;
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) )
173 Signals.connectData(
174 getStruct(),
175 "focus-home-or-end",
176 cast(GCallback)&callBackFocusHomeOrEnd,
177 this,
178 null,
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);
193 return consumed;
196 gboolean delegate(GtkDirectionType, Toolbar)[] onMoveFocusListeners;
197 void addOnMoveFocus(gboolean delegate(GtkDirectionType, Toolbar) dlg)
199 if ( !("move-focus" in connectedSignals) )
201 Signals.connectData(
202 getStruct(),
203 "move-focus",
204 cast(GCallback)&callBackMoveFocus,
205 this,
206 null,
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 )
218 dlg(dir, toolbar);
221 return consumed;
224 void delegate(GtkOrientation, Toolbar)[] onOrientationChangedListeners;
225 void addOnOrientationChanged(void delegate(GtkOrientation, Toolbar) dlg)
227 if ( !("orientation-changed" in connectedSignals) )
229 Signals.connectData(
230 getStruct(),
231 "orientation-changed",
232 cast(GCallback)&callBackOrientationChanged,
233 this,
234 null,
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);
249 return consumed;
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) )
257 Signals.connectData(
258 getStruct(),
259 "popup-context-menu",
260 cast(GCallback)&callBackPopupContextMenu,
261 this,
262 null,
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);
277 return consumed;
280 void delegate(GtkToolbarStyle, Toolbar)[] onStyleChangedListeners;
281 void addOnStyleChanged(void delegate(GtkToolbarStyle, Toolbar) dlg)
283 if ( !("style-changed" in connectedSignals) )
285 Signals.connectData(
286 getStruct(),
287 "style-changed",
288 cast(GCallback)&callBackStyleChanged,
289 this,
290 null,
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 )
302 dlg(style, toolbar);
305 return consumed;
314 * Creates a new toolbar.
315 * Returns:
316 * the newly-created toolbar.
318 public this ()
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.
328 * toolbar:
329 * a GtkToolbar
330 * item:
331 * a GtkToolItem
332 * pos:
333 * the position of the new item
334 * Since 2.4
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.
345 * toolbar:
346 * a GtkToolbar
347 * item:
348 * a GtkToolItem that is a child of toolbar
349 * Returns:
350 * the position of item on the toolbar.
351 * Since 2.4
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.
361 * toolbar:
362 * a GtkToolbar
363 * Returns:
364 * the number of items on the toolbar
365 * Since 2.4
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.
376 * toolbar:
377 * a GtkToolbar
378 * n:
379 * A position on the toolbar
380 * Returns:
381 * The n'th GtkToolItem on toolbar, or NULL if there
382 * isn't an n'th item.
383 * Since 2.4
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
395 * inserted.
396 * x and y are in toolbar coordinates.
397 * toolbar:
398 * a GtkToolbar
399 * x:
400 * x coordinate of a point on the toolbar
401 * y:
402 * y coordinate of a point on the toolbar
403 * Returns:
404 * The position corresponding to the point (x, y) on the toolbar.
405 * Since 2.4
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_
417 * is ignored.
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
421 * toolbar.
422 * toolbar:
423 * a GtkToolbar
424 * tool_item:
425 * a GtkToolItem, or NULL to turn of highlighting
426 * index_:
427 * a position on toolbar
428 * Since 2.4
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
440 * overflow menu.
441 * toolbar:
442 * a GtkToolbar
443 * show_arrow:
444 * Whether to show an overflow menu
445 * Since 2.4
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.
455 * toolbar:
456 * a GtkToolbar.
457 * orientation:
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.
468 * toolbar:
469 * a GtkToolbar.
470 * enable:
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);
480 * Warning
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.
484 * toolbar:
485 * a GtkToolbar
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().
496 * toolbar:
497 * a GtkToolbar
498 * Returns:
499 * TRUE if the toolbar has an overflow menu.
500 * Since 2.4
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().
511 * toolbar:
512 * a GtkToolbar
513 * Returns:
514 * the 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().
525 * toolbar:
526 * a GtkToolbar
527 * Returns:
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().
539 * toolbar:
540 * a GtkToolbar
541 * Returns:
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().
553 * toolbar:
554 * a GtkToolbar
555 * Returns:
556 * The relief style of buttons on toolbar.
557 * Since 2.4
559 public GtkReliefStyle getReliefStyle()
561 // GtkReliefStyle gtk_toolbar_get_relief_style (GtkToolbar *toolbar);
562 return gtk_toolbar_get_relief_style(gtkToolbar);
566 * Warning
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.
572 * toolbar:
573 * a GtkToolbar.
574 * text:
575 * give your toolbar button a label.
576 * tooltip_text:
577 * a string that appears when the user holds the mouse over this item.
578 * tooltip_private_text:
579 * use with GtkTipsQuery.
580 * icon:
581 * a GtkWidget that should be used as the button's icon.
582 * callback:
583 * the function to be executed when the button is pressed.
584 * user_data:
585 * a pointer to any data you wish to be passed to the callback.
586 * Returns:
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) );
596 * Warning
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.
601 * toolbar:
602 * a GtkToolbar.
603 * text:
604 * give your toolbar button a label.
605 * tooltip_text:
606 * a string that appears when the user holds the mouse over this item.
607 * tooltip_private_text:
608 * use with GtkTipsQuery.
609 * icon:
610 * a GtkWidget that should be used as the button's icon.
611 * callback:
612 * the function to be executed when the button is pressed.
613 * user_data:
614 * a pointer to any data you wish to be passed to the callback.
615 * Returns:
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) );
625 * Warning
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.
631 * toolbar:
632 * a GtkToolbar.
633 * text:
634 * give your toolbar button a label.
635 * tooltip_text:
636 * a string that appears when the user holds the mouse over this item.
637 * tooltip_private_text:
638 * use with GtkTipsQuery.
639 * icon:
640 * a GtkWidget that should be used as the button's icon.
641 * callback:
642 * the function to be executed when the button is pressed.
643 * user_data:
644 * a pointer to any data you wish to be passed to the callback.
645 * position:
646 * the number of widgets to insert this item after.
647 * Returns:
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) );
657 * Warning
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.
660 * toolbar:
661 * a GtkToolbar.
663 public void appendSpace()
665 // void gtk_toolbar_append_space (GtkToolbar *toolbar);
666 gtk_toolbar_append_space(gtkToolbar);
670 * Warning
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.
673 * toolbar:
674 * a GtkToolbar.
676 public void prependSpace()
678 // void gtk_toolbar_prepend_space (GtkToolbar *toolbar);
679 gtk_toolbar_prepend_space(gtkToolbar);
683 * Warning
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.
686 * toolbar:
687 * a GtkToolbar
688 * 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);
698 * Warning
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
704 * be NULL.
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.
707 * toolbar:
708 * a GtkToolbar.
709 * type:
710 * a value of type GtkToolbarChildType that determines what widget will be.
711 * widget:
712 * a GtkWidget, or NULL.
713 * text:
714 * the element's label.
715 * tooltip_text:
716 * the element's tooltip.
717 * tooltip_private_text:
718 * used for context-sensitive help about this toolbar element.
719 * icon:
720 * a GtkWidget that provides pictorial representation of the element's function.
721 * callback:
722 * the function to be executed when the button is pressed.
723 * user_data:
724 * any data you wish to pass to the callback.
725 * Returns:
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) );
735 * Warning
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
741 * be NULL.
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.
744 * toolbar:
745 * a GtkToolbar.
746 * type:
747 * a value of type GtkToolbarChildType that determines what widget will be.
748 * widget:
749 * a GtkWidget, or NULL
750 * text:
751 * the element's label.
752 * tooltip_text:
753 * the element's tooltip.
754 * tooltip_private_text:
755 * used for context-sensitive help about this toolbar element.
756 * icon:
757 * a GtkWidget that provides pictorial representation of the element's function.
758 * callback:
759 * the function to be executed when the button is pressed.
760 * user_data:
761 * any data you wish to pass to the callback.
762 * Returns:
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) );
772 * Warning
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
778 * be NULL.
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.
781 * toolbar:
782 * a GtkToolbar.
783 * type:
784 * a value of type GtkToolbarChildType that determines what widget
785 * will be.
786 * widget:
787 * a GtkWidget, or NULL.
788 * text:
789 * the element's label.
790 * tooltip_text:
791 * the element's tooltip.
792 * tooltip_private_text:
793 * used for context-sensitive help about this toolbar element.
794 * icon:
795 * a GtkWidget that provides pictorial representation of the element's function.
796 * callback:
797 * the function to be executed when the button is pressed.
798 * user_data:
799 * any data you wish to pass to the callback.
800 * position:
801 * the number of widgets to insert this element after.
802 * Returns:
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) );
812 * Warning
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.
815 * toolbar:
816 * a GtkToolbar.
817 * widget:
818 * a GtkWidget to add to the toolbar.
819 * tooltip_text:
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));
831 * Warning
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.
834 * toolbar:
835 * a GtkToolbar.
836 * widget:
837 * a GtkWidget to add to the toolbar.
838 * tooltip_text:
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));
850 * Warning
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.
853 * toolbar:
854 * a GtkToolbar.
855 * widget:
856 * a GtkWidget to add to the toolbar.
857 * tooltip_text:
858 * the element's tooltip.
859 * tooltip_private_text:
860 * used for context-sensitive help about this toolbar element.
861 * position:
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.
872 * toolbar:
873 * a GtkToolbar.
874 * style:
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);
884 * Warning
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.
891 * toolbar:
892 * A GtkToolbar
893 * stock_id:
894 * The id of the stock item you want to insert
895 * tooltip_text:
896 * The text in the tooltip of the toolbar button
897 * tooltip_private_text:
898 * The private text of the tooltip
899 * callback:
900 * The callback called when the toolbar button is clicked.
901 * user_data:
902 * user data passed to callback
903 * position:
904 * The position the button shall be inserted at.
905 * -1 means at the end.
906 * Returns:
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) );
916 * Warning
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
921 * icon size.
922 * This should only be used for special-purpose toolbars, normal
923 * application toolbars should respect the user preferences for the
924 * size of icons.
925 * toolbar:
926 * A GtkToolbar
927 * icon_size:
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);
937 * Warning
938 * gtk_toolbar_remove_space is deprecated and should not be used in newly-written code.
939 * Removes a space from the specified position.
940 * toolbar:
941 * a GtkToolbar.
942 * 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.
954 * toolbar:
955 * a GtkToolbar
956 * Property Details
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
964 * size of icons.
965 * Default value: GTK_ICON_SIZE_LARGE_TOOLBAR
966 * Since 2.10
968 public void unsetStyle()
970 // void gtk_toolbar_unset_style (GtkToolbar *toolbar);
971 gtk_toolbar_unset_style(gtkToolbar);