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 = GtkNotebook.html
49 * - GtkWidget* -> Widget
55 private import gtk
.gtktypes
;
57 private import lib
.gtk
;
59 private import glib
.Str
;
60 private import gtk
.Label
;
61 private import gtk
.Widget
;
65 * The GtkNotebook widget is a GtkContainer whose children are pages that
66 * can be switched between using tab labels along one edge.
67 * There are many configuration options for GtkNotebook. Among other
68 * things, you can choose on which edge the tabs appear
69 * (see gtk_notebook_set_tab_pos()), whether, if there are too many
70 * tabs to fit the noteobook should be made bigger or scrolling
71 * arrows added (see gtk_notebook_set_scrollable), and whether there
72 * will be a popup menu allowing the users to switch pages.
73 * (see gtk_notebook_enable_popup(), gtk_noteobook_disable_popup())
75 private import gtk
.Container
;
76 public class Notebook
: Container
79 /** the main Gtk struct */
80 protected GtkNotebook
* gtkNotebook
;
83 public GtkNotebook
* getNotebookStruct()
89 /** the main Gtk struct as a void* */
90 protected void* getStruct()
92 return cast(void*)gtkNotebook
;
96 * Sets our main struct and passes it to the parent class
98 public this (GtkNotebook
* gtkNotebook
)
100 super(cast(GtkContainer
*)gtkNotebook
);
101 this.gtkNotebook
= gtkNotebook
;
104 /** The GtkNotebookTab is not documented */
105 public enum GtkNotebookTab
107 GTK_NOTEBOOK_TAB_FIRST
,
108 GTK_NOTEBOOK_TAB_LAST
110 alias GtkNotebookTab NotebookTab
;
113 * Append a page with a widget and a text for a label
115 public int appendPage(Widget child
, char[] tabLabel
)
117 return appendPage(child
, new Label(tabLabel
));
120 void setCurrentPage(Widget child
)
122 gtk_notebook_set_current_page(gtkNotebook
,gtk_notebook_page_num(gtkNotebook
, child
.getWidgetStruct()));
130 // imports for the signal processing
131 private import gobject
.Signals
;
132 private import gdk
.gdktypes
;
133 int[char[]] connectedSignals
;
135 void delegate(gint
, Notebook
)[] onChangeCurrentPageListeners
;
136 void addOnChangeCurrentPage(void delegate(gint
, Notebook
) dlg
)
138 if ( !("change-current-page" in connectedSignals
) )
142 "change-current-page",
143 cast(GCallback
)&callBackChangeCurrentPage
,
146 cast(ConnectFlags
)0);
147 connectedSignals
["change-current-page"] = 1;
149 onChangeCurrentPageListeners
~= dlg
;
151 extern(C
) static void callBackChangeCurrentPage(GtkNotebook
* notebookStruct
, gint arg1
, Notebook notebook
)
153 bit consumed
= false;
155 foreach ( void delegate(gint
, Notebook
) dlg
; notebook
.onChangeCurrentPageListeners
)
163 gboolean
delegate(GtkNotebookTab
, Notebook
)[] onFocusTabListeners
;
164 void addOnFocusTab(gboolean
delegate(GtkNotebookTab
, Notebook
) dlg
)
166 if ( !("focus-tab" in connectedSignals
) )
171 cast(GCallback
)&callBackFocusTab
,
174 cast(ConnectFlags
)0);
175 connectedSignals
["focus-tab"] = 1;
177 onFocusTabListeners
~= dlg
;
179 extern(C
) static void callBackFocusTab(GtkNotebook
* notebookStruct
, GtkNotebookTab arg1
, Notebook notebook
)
181 bit consumed
= false;
183 foreach ( gboolean
delegate(GtkNotebookTab
, Notebook
) dlg
; notebook
.onFocusTabListeners
)
191 void delegate(GtkDirectionType
, Notebook
)[] onMoveFocusOutListeners
;
192 void addOnMoveFocusOut(void delegate(GtkDirectionType
, Notebook
) dlg
)
194 if ( !("move-focus-out" in connectedSignals
) )
199 cast(GCallback
)&callBackMoveFocusOut
,
202 cast(ConnectFlags
)0);
203 connectedSignals
["move-focus-out"] = 1;
205 onMoveFocusOutListeners
~= dlg
;
207 extern(C
) static void callBackMoveFocusOut(GtkNotebook
* notebookStruct
, GtkDirectionType arg1
, Notebook notebook
)
209 bit consumed
= false;
211 foreach ( void delegate(GtkDirectionType
, Notebook
) dlg
; notebook
.onMoveFocusOutListeners
)
219 void delegate(Widget
, guint
, Notebook
)[] onPageAddedListeners
;
220 void addOnPageAdded(void delegate(Widget
, guint
, Notebook
) dlg
)
222 if ( !("page-added" in connectedSignals
) )
227 cast(GCallback
)&callBackPageAdded
,
230 cast(ConnectFlags
)0);
231 connectedSignals
["page-added"] = 1;
233 onPageAddedListeners
~= dlg
;
235 extern(C
) static void callBackPageAdded(GtkNotebook
* notebookStruct
, GtkWidget
* child
, guint pageNum
, Notebook notebook
)
237 bit consumed
= false;
239 foreach ( void delegate(Widget
, guint
, Notebook
) dlg
; notebook
.onPageAddedListeners
)
241 dlg(new Widget(child
), pageNum
, notebook
);
247 void delegate(Widget
, guint
, Notebook
)[] onPageRemovedListeners
;
248 void addOnPageRemoved(void delegate(Widget
, guint
, Notebook
) dlg
)
250 if ( !("page-removed" in connectedSignals
) )
255 cast(GCallback
)&callBackPageRemoved
,
258 cast(ConnectFlags
)0);
259 connectedSignals
["page-removed"] = 1;
261 onPageRemovedListeners
~= dlg
;
263 extern(C
) static void callBackPageRemoved(GtkNotebook
* notebookStruct
, GtkWidget
* child
, guint pageNum
, Notebook notebook
)
265 bit consumed
= false;
267 foreach ( void delegate(Widget
, guint
, Notebook
) dlg
; notebook
.onPageRemovedListeners
)
269 dlg(new Widget(child
), pageNum
, notebook
);
275 void delegate(Widget
, guint
, Notebook
)[] onPageReorderedListeners
;
276 void addOnPageReordered(void delegate(Widget
, guint
, Notebook
) dlg
)
278 if ( !("page-reordered" in connectedSignals
) )
283 cast(GCallback
)&callBackPageReordered
,
286 cast(ConnectFlags
)0);
287 connectedSignals
["page-reordered"] = 1;
289 onPageReorderedListeners
~= dlg
;
291 extern(C
) static void callBackPageReordered(GtkNotebook
* notebookStruct
, GtkWidget
* child
, guint pageNum
, Notebook notebook
)
293 bit consumed
= false;
295 foreach ( void delegate(Widget
, guint
, Notebook
) dlg
; notebook
.onPageReorderedListeners
)
297 dlg(new Widget(child
), pageNum
, notebook
);
303 void delegate(GtkDirectionType
, gboolean
, Notebook
)[] onReorderTabListeners
;
304 void addOnReorderTab(void delegate(GtkDirectionType
, gboolean
, Notebook
) dlg
)
306 if ( !("reorder-tab" in connectedSignals
) )
311 cast(GCallback
)&callBackReorderTab
,
314 cast(ConnectFlags
)0);
315 connectedSignals
["reorder-tab"] = 1;
317 onReorderTabListeners
~= dlg
;
319 extern(C
) static void callBackReorderTab(GtkNotebook
* notebookStruct
, GtkDirectionType arg1
, gboolean arg2
, Notebook notebook
)
321 bit consumed
= false;
323 foreach ( void delegate(GtkDirectionType
, gboolean
, Notebook
) dlg
; notebook
.onReorderTabListeners
)
325 dlg(arg1
, arg2
, notebook
);
331 gboolean
delegate(gboolean
, Notebook
)[] onSelectPageListeners
;
332 void addOnSelectPage(gboolean
delegate(gboolean
, Notebook
) dlg
)
334 if ( !("select-page" in connectedSignals
) )
339 cast(GCallback
)&callBackSelectPage
,
342 cast(ConnectFlags
)0);
343 connectedSignals
["select-page"] = 1;
345 onSelectPageListeners
~= dlg
;
347 extern(C
) static void callBackSelectPage(GtkNotebook
* notebookStruct
, gboolean arg1
, Notebook notebook
)
349 bit consumed
= false;
351 foreach ( gboolean
delegate(gboolean
, Notebook
) dlg
; notebook
.onSelectPageListeners
)
359 void delegate(GtkNotebookPage
*, guint
, Notebook
)[] onSwitchPageListeners
;
360 void addOnSwitchPage(void delegate(GtkNotebookPage
*, guint
, Notebook
) dlg
)
362 if ( !("switch-page" in connectedSignals
) )
367 cast(GCallback
)&callBackSwitchPage
,
370 cast(ConnectFlags
)0);
371 connectedSignals
["switch-page"] = 1;
373 onSwitchPageListeners
~= dlg
;
375 extern(C
) static void callBackSwitchPage(GtkNotebook
* notebookStruct
, GtkNotebookPage
* page
, guint pageNum
, Notebook notebook
)
377 bit consumed
= false;
379 foreach ( void delegate(GtkNotebookPage
*, guint
, Notebook
) dlg
; notebook
.onSwitchPageListeners
)
381 dlg(page
, pageNum
, notebook
);
391 * Creates a new GtkNotebook widget with no pages.
393 * the newly created GtkNotebook
397 // GtkWidget* gtk_notebook_new (void);
398 this(cast(GtkNotebook
*)gtk_notebook_new() );
402 * Appends a page to notebook.
406 * the GtkWidget to use as the contents of the page.
408 * the GtkWidget to be used as the label for the page,
409 * or NULL to use the default label, 'page N'.
411 * the index (starting from 0) of the appended
412 * page in the notebook, or -1 if function fails
414 public int appendPage(Widget child
, Widget tabLabel
)
416 // gint gtk_notebook_append_page (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label);
417 return gtk_notebook_append_page(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), (tabLabel
is null) ?
null : tabLabel
.getWidgetStruct());
421 * Appends a page to notebook, specifying the widget to use as the
422 * label in the popup menu.
426 * the GtkWidget to use as the contents of the page.
428 * the GtkWidget to be used as the label for the page,
429 * or NULL to use the default label, 'page N'.
431 * the widget to use as a label for the page-switch
432 * menu, if that is enabled. If NULL, and tab_label
433 * is a GtkLabel or NULL, then the menu label will be
434 * a newly created label with the same text as tab_label;
435 * If tab_label is not a GtkLabel, menu_label must be
436 * specified if the page-switch menu is to be used.
438 * the index (starting from 0) of the appended
439 * page in the notebook, or -1 if function fails
441 public int appendPageMenu(Widget child
, Widget tabLabel
, Widget menuLabel
)
443 // gint gtk_notebook_append_page_menu (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label, GtkWidget *menu_label);
444 return gtk_notebook_append_page_menu(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), (tabLabel
is null) ?
null : tabLabel
.getWidgetStruct(), (menuLabel
is null) ?
null : menuLabel
.getWidgetStruct());
448 * Prepends a page to notebook.
452 * the GtkWidget to use as the contents of the page.
454 * the GtkWidget to be used as the label for the page,
455 * or NULL to use the default label, 'page N'.
457 * the index (starting from 0) of the prepended
458 * page in the notebook, or -1 if function fails
460 public int prependPage(Widget child
, Widget tabLabel
)
462 // gint gtk_notebook_prepend_page (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label);
463 return gtk_notebook_prepend_page(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), (tabLabel
is null) ?
null : tabLabel
.getWidgetStruct());
467 * Prepends a page to notebook, specifying the widget to use as the
468 * label in the popup menu.
472 * the GtkWidget to use as the contents of the page.
474 * the GtkWidget to be used as the label for the page,
475 * or NULL to use the default label, 'page N'.
477 * the widget to use as a label for the page-switch
478 * menu, if that is enabled. If NULL, and tab_label
479 * is a GtkLabel or NULL, then the menu label will be
480 * a newly created label with the same text as tab_label;
481 * If tab_label is not a GtkLabel, menu_label must be
482 * specified if the page-switch menu is to be used.
484 * the index (starting from 0) of the prepended
485 * page in the notebook, or -1 if function fails
487 public int prependPageMenu(Widget child
, Widget tabLabel
, Widget menuLabel
)
489 // gint gtk_notebook_prepend_page_menu (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label, GtkWidget *menu_label);
490 return gtk_notebook_prepend_page_menu(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), (tabLabel
is null) ?
null : tabLabel
.getWidgetStruct(), (menuLabel
is null) ?
null : menuLabel
.getWidgetStruct());
494 * Insert a page into notebook at the given position.
498 * the GtkWidget to use as the contents of the page.
500 * the GtkWidget to be used as the label for the page,
501 * or NULL to use the default label, 'page N'.
503 * the index (starting at 0) at which to insert the page,
504 * or -1 to append the page after all other pages.
506 * the index (starting from 0) of the inserted
507 * page in the notebook, or -1 if function fails
509 public int insertPage(Widget child
, Widget tabLabel
, int position
)
511 // gint gtk_notebook_insert_page (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label, gint position);
512 return gtk_notebook_insert_page(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), (tabLabel
is null) ?
null : tabLabel
.getWidgetStruct(), position
);
516 * Insert a page into notebook at the given position, specifying
517 * the widget to use as the label in the popup menu.
521 * the GtkWidget to use as the contents of the page.
523 * the GtkWidget to be used as the label for the page,
524 * or NULL to use the default label, 'page N'.
526 * the widget to use as a label for the page-switch
527 * menu, if that is enabled. If NULL, and tab_label
528 * is a GtkLabel or NULL, then the menu label will be
529 * a newly created label with the same text as tab_label;
530 * If tab_label is not a GtkLabel, menu_label must be
531 * specified if the page-switch menu is to be used.
533 * the index (starting at 0) at which to insert the page,
534 * or -1 to append the page after all other pages.
536 * the index (starting from 0) of the inserted
537 * page in the notebook
539 public int insertPageMenu(Widget child
, Widget tabLabel
, Widget menuLabel
, int position
)
541 // gint gtk_notebook_insert_page_menu (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label, GtkWidget *menu_label, gint position);
542 return gtk_notebook_insert_page_menu(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), (tabLabel
is null) ?
null : tabLabel
.getWidgetStruct(), (menuLabel
is null) ?
null : menuLabel
.getWidgetStruct(), position
);
546 * Removes a page from the notebook given its index
551 * the index of a notebook page, starting
552 * from 0. If -1, the last page will
555 public void removePage(int pageNum
)
557 // void gtk_notebook_remove_page (GtkNotebook *notebook, gint page_num);
558 gtk_notebook_remove_page(gtkNotebook
, pageNum
);
563 * Finds the index of the page which contains the given child
570 * the index of the page containing child, or
571 * -1 if child is not in the notebook.
573 public int pageNum(Widget child
)
575 // gint gtk_notebook_page_num (GtkNotebook *notebook, GtkWidget *child);
576 return gtk_notebook_page_num(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct());
581 * Switches to the next page. Nothing happens if the current page is
586 public void nextPage()
588 // void gtk_notebook_next_page (GtkNotebook *notebook);
589 gtk_notebook_next_page(gtkNotebook
);
593 * Switches to the previous page. Nothing happens if the current page
598 public void prevPage()
600 // void gtk_notebook_prev_page (GtkNotebook *notebook);
601 gtk_notebook_prev_page(gtkNotebook
);
605 * Reorders the page containing child, so that it appears in position
606 * position. If position is greater than or equal to the number of
607 * children in the list or negative, child will be moved to the end
614 * the new position, or -1 to move to the end
616 public void reorderChild(Widget child
, int position
)
618 // void gtk_notebook_reorder_child (GtkNotebook *notebook, GtkWidget *child, gint position);
619 gtk_notebook_reorder_child(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), position
);
623 * Sets the edge at which the tabs for switching pages in the
624 * notebook are drawn.
628 * the edge to draw the tabs at.
630 public void setTabPos(GtkPositionType pos
)
632 // void gtk_notebook_set_tab_pos (GtkNotebook *notebook, GtkPositionType pos);
633 gtk_notebook_set_tab_pos(gtkNotebook
, pos
);
637 * Sets whether to show the tabs for the notebook or not.
641 * TRUE if the tabs should be shown.
643 public void setShowTabs(int showTabs
)
645 // void gtk_notebook_set_show_tabs (GtkNotebook *notebook, gboolean show_tabs);
646 gtk_notebook_set_show_tabs(gtkNotebook
, showTabs
);
650 * Sets whether a bevel will be drawn around the notebook pages.
651 * This only has a visual effect when the tabs are not shown.
652 * See gtk_notebook_set_show_tabs().
656 * TRUE if a bevel should be drawn around the notebook.
658 public void setShowBorder(int showBorder
)
660 // void gtk_notebook_set_show_border (GtkNotebook *notebook, gboolean show_border);
661 gtk_notebook_set_show_border(gtkNotebook
, showBorder
);
665 * Sets whether the tab label area will have arrows for scrolling if
666 * there are too many tabs to fit in the area.
670 * TRUE if scroll arrows should be added
672 public void setScrollable(int scrollable
)
674 // void gtk_notebook_set_scrollable (GtkNotebook *notebook, gboolean scrollable);
675 gtk_notebook_set_scrollable(gtkNotebook
, scrollable
);
680 * gtk_notebook_set_tab_border is deprecated and should not be used in newly-written code.
681 * Sets the width the border around the tab labels
682 * in a notebook. This is equivalent to calling
683 * gtk_notebook_set_tab_hborder (notebook, border_width) followed
684 * by gtk_notebook_set_tab_vborder (notebook, border_width).
688 * width of the border around the tab labels.
690 public void setTabBorder(uint borderWidth
)
692 // void gtk_notebook_set_tab_border (GtkNotebook *notebook, guint border_width);
693 gtk_notebook_set_tab_border(gtkNotebook
, borderWidth
);
697 * Enables the popup menu: if the user clicks with the right mouse button on
698 * the bookmarks, a menu with all the pages will be popped up.
702 public void popupEnable()
704 // void gtk_notebook_popup_enable (GtkNotebook *notebook);
705 gtk_notebook_popup_enable(gtkNotebook
);
709 * Disables the popup menu.
713 public void popupDisable()
715 // void gtk_notebook_popup_disable (GtkNotebook *notebook);
716 gtk_notebook_popup_disable(gtkNotebook
);
720 * Returns the page number of the current page.
724 * the index (starting from 0) of the current
725 * page in the notebook. If the notebook has no pages, then
726 * -1 will be returned.
728 public int getCurrentPage()
730 // gint gtk_notebook_get_current_page (GtkNotebook *notebook);
731 return gtk_notebook_get_current_page(gtkNotebook
);
735 * Retrieves the menu label widget of the page containing child.
739 * a widget contained in a page of notebook
741 * the menu label, or NULL if the
742 * notebook page does not have a menu label other
743 * than the default (the tab label).
745 public Widget
getMenuLabel(Widget child
)
747 // GtkWidget* gtk_notebook_get_menu_label (GtkNotebook *notebook, GtkWidget *child);
748 return new Widget( gtk_notebook_get_menu_label(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct()) );
752 * Returns the child widget contained in page number page_num.
756 * the index of a page in the noteobok, or -1
757 * to get the last page.
759 * the child widget, or NULL if page_num is
762 public Widget
getNthPage(int pageNum
)
764 // GtkWidget* gtk_notebook_get_nth_page (GtkNotebook *notebook, gint page_num);
765 return new Widget( gtk_notebook_get_nth_page(gtkNotebook
, pageNum
) );
769 * Gets the number of pages in a notebook.
773 * the number of pages in the notebook.
776 public int getNPages()
778 // gint gtk_notebook_get_n_pages (GtkNotebook *notebook);
779 return gtk_notebook_get_n_pages(gtkNotebook
);
783 * Returns the tab label widget for the page child. NULL is returned
784 * if child is not in notebook or if no tab label has specifically
785 * been set for child.
793 public Widget
getTabLabel(Widget child
)
795 // GtkWidget* gtk_notebook_get_tab_label (GtkNotebook *notebook, GtkWidget *child);
796 return new Widget( gtk_notebook_get_tab_label(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct()) );
800 * Query the packing attributes for the tab label of the page
807 * location to store the expand value (or NULL)
809 * location to store the fill value (or NULL)
811 * location to store the pack_type (or NULL)
813 public void queryTabLabelPacking(Widget child
, int* expand
, int* fill
, GtkPackType
* packType
)
815 // void gtk_notebook_query_tab_label_packing (GtkNotebook *notebook, GtkWidget *child, gboolean *expand, gboolean *fill, GtkPackType *pack_type);
816 gtk_notebook_query_tab_label_packing(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), expand
, fill
, packType
);
821 * gtk_notebook_set_homogeneous_tabs is deprecated and should not be used in newly-written code.
822 * Sets whether the tabs must have all the same size or not.
826 * TRUE if all tabs should be the same size.
828 public void setHomogeneousTabs(int homogeneous
)
830 // void gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook, gboolean homogeneous);
831 gtk_notebook_set_homogeneous_tabs(gtkNotebook
, homogeneous
);
835 * Changes the menu label for the page containing child.
841 * the menu label, or NULL for default
843 public void setMenuLabel(Widget child
, Widget menuLabel
)
845 // void gtk_notebook_set_menu_label (GtkNotebook *notebook, GtkWidget *child, GtkWidget *menu_label);
846 gtk_notebook_set_menu_label(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), (menuLabel
is null) ?
null : menuLabel
.getWidgetStruct());
850 * Creates a new label and sets it as the menu label of child.
858 public void setMenuLabelText(Widget child
, char[] menuText
)
860 // void gtk_notebook_set_menu_label_text (GtkNotebook *notebook, GtkWidget *child, const gchar *menu_text);
861 gtk_notebook_set_menu_label_text(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), Str
.toStringz(menuText
));
866 * gtk_notebook_set_tab_hborder is deprecated and should not be used in newly-written code.
867 * Sets the width of the horizontal border of tab labels.
871 * width of the horizontal border of tab labels.
873 public void setTabHborder(uint tabHborder
)
875 // void gtk_notebook_set_tab_hborder (GtkNotebook *notebook, guint tab_hborder);
876 gtk_notebook_set_tab_hborder(gtkNotebook
, tabHborder
);
880 * Changes the tab label for child. If NULL is specified
881 * for tab_label, then the page will have the label 'page N'.
887 * the tab label widget to use, or NULL for default tab
890 public void setTabLabel(Widget child
, Widget tabLabel
)
892 // void gtk_notebook_set_tab_label (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label);
893 gtk_notebook_set_tab_label(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), (tabLabel
is null) ?
null : tabLabel
.getWidgetStruct());
897 * Sets the packing parameters for the tab label of the page
898 * containing child. See gtk_box_pack_start() for the exact meaning
905 * whether to expand the bookmark or not
907 * whether the bookmark should fill the allocated area or not
909 * the position of the bookmark
911 public void setTabLabelPacking(Widget child
, int expand
, int fill
, GtkPackType packType
)
913 // void gtk_notebook_set_tab_label_packing (GtkNotebook *notebook, GtkWidget *child, gboolean expand, gboolean fill, GtkPackType pack_type);
914 gtk_notebook_set_tab_label_packing(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), expand
, fill
, packType
);
918 * Creates a new label and sets it as the tab label for the page
927 public void setTabLabelText(Widget child
, char[] tabText
)
929 // void gtk_notebook_set_tab_label_text (GtkNotebook *notebook, GtkWidget *child, const gchar *tab_text);
930 gtk_notebook_set_tab_label_text(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), Str
.toStringz(tabText
));
935 * gtk_notebook_set_tab_vborder is deprecated and should not be used in newly-written code.
936 * Sets the width of the vertical border of tab labels.
940 * width of the vertical border of tab labels.
942 public void setTabVborder(uint tabVborder
)
944 // void gtk_notebook_set_tab_vborder (GtkNotebook *notebook, guint tab_vborder);
945 gtk_notebook_set_tab_vborder(gtkNotebook
, tabVborder
);
949 * Sets whether the notebook tab can be reordered
950 * via drag and drop or not.
956 * whether the tab is reorderable or not.
959 public void setTabReorderable(Widget child
, int reorderable
)
961 // void gtk_notebook_set_tab_reorderable (GtkNotebook *notebook, GtkWidget *child, gboolean reorderable);
962 gtk_notebook_set_tab_reorderable(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), reorderable
);
966 * Sets whether the tab can be detached from notebook to another
967 * notebook or widget.
968 * Note that 2 notebooks must share a common group identificator
969 * (see gtk_notebook_set_group_id()) to allow automatic tabs
970 * interchange between them.
971 * If you want a widget to interact with a notebook through DnD
972 * (i.e.: accept dragged tabs from it) it must be set as a drop
973 * destination and accept the target "GTK_NOTEBOOK_TAB". The notebook
974 * will fill the selection with a GtkWidget** pointing to the child
975 * widget that corresponds to the dropped tab.
977 * on_drop_zone_drag_data_received (GtkWidget *widget,
978 * GdkDragContext *context,
981 * GtkSelectionData *selection_data,
984 * gpointer user_data)
986 * GtkWidget *notebook;
988 * notebook = gtk_drag_get_source_widget (context);
989 * child = (void*) selection_data->data;
990 * process_widget (*child);
991 * gtk_container_remove (GTK_CONTAINER (notebook), *child);
993 * If you want a notebook to accept drags from other widgets,
994 * you will have to set your own DnD code to do it.
1000 * whether the tab is detachable or not
1003 public void setTabDetachable(Widget child
, int detachable
)
1005 // void gtk_notebook_set_tab_detachable (GtkNotebook *notebook, GtkWidget *child, gboolean detachable);
1006 gtk_notebook_set_tab_detachable(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct(), detachable
);
1010 * Retrieves the text of the menu label for the page containing
1015 * the child widget of a page of the notebook.
1017 * value: the text of the tab label, or NULL if the
1018 * widget does not have a menu label other than
1019 * the default menu label, or the menu label widget
1020 * is not a GtkLabel. The string is owned by
1021 * the widget and must not be freed.
1023 public char[] getMenuLabelText(Widget child
)
1025 // const gchar* gtk_notebook_get_menu_label_text (GtkNotebook *notebook, GtkWidget *child);
1026 return Str
.toString(gtk_notebook_get_menu_label_text(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct()) );
1030 * Returns whether the tab label area has arrows for scrolling. See
1031 * gtk_notebook_set_scrollable().
1035 * TRUE if arrows for scrolling are present
1037 public int getScrollable()
1039 // gboolean gtk_notebook_get_scrollable (GtkNotebook *notebook);
1040 return gtk_notebook_get_scrollable(gtkNotebook
);
1044 * Returns whether a bevel will be drawn around the notebook pages. See
1045 * gtk_notebook_set_show_border().
1049 * TRUE if the bevel is drawn
1051 public int getShowBorder()
1053 // gboolean gtk_notebook_get_show_border (GtkNotebook *notebook);
1054 return gtk_notebook_get_show_border(gtkNotebook
);
1058 * Returns whether the tabs of the notebook are shown. See
1059 * gtk_notebook_set_show_tabs().
1063 * TRUE if the tabs are shown
1065 public int getShowTabs()
1067 // gboolean gtk_notebook_get_show_tabs (GtkNotebook *notebook);
1068 return gtk_notebook_get_show_tabs(gtkNotebook
);
1072 * Retrieves the text of the tab label for the page containing
1077 * a widget contained in a page of notebook
1079 * value: the text of the tab label, or NULL if the
1080 * tab label widget is not a GtkLabel. The
1081 * string is owned by the widget and must not
1084 public char[] getTabLabelText(Widget child
)
1086 // const gchar* gtk_notebook_get_tab_label_text (GtkNotebook *notebook, GtkWidget *child);
1087 return Str
.toString(gtk_notebook_get_tab_label_text(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct()) );
1091 * Gets the edge at which the tabs for switching pages in the
1092 * notebook are drawn.
1096 * the edge at which the tabs are drawn
1098 public GtkPositionType
getTabPos()
1100 // GtkPositionType gtk_notebook_get_tab_pos (GtkNotebook *notebook);
1101 return gtk_notebook_get_tab_pos(gtkNotebook
);
1105 * Gets whether the tab can be reordered via drag and drop or not.
1111 * TRUE if the tab is reorderable.
1114 public int getTabReorderable(Widget child
)
1116 // gboolean gtk_notebook_get_tab_reorderable (GtkNotebook *notebook, GtkWidget *child);
1117 return gtk_notebook_get_tab_reorderable(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct());
1121 * Returns whether the tab contents can be detached from notebook.
1127 * TRUE if the tab is detachable.
1130 public int getTabDetachable(Widget child
)
1132 // gboolean gtk_notebook_get_tab_detachable (GtkNotebook *notebook, GtkWidget *child);
1133 return gtk_notebook_get_tab_detachable(gtkNotebook
, (child
is null) ?
null : child
.getWidgetStruct());
1137 * Switches to the page number page_num.
1138 * Note that due to historical reasons, GtkNotebook refuses
1139 * to switch to a page unless the child widget is visible.
1140 * Therefore, it is recommended to show child widgets before
1141 * adding them to a notebook.
1145 * index of the page to switch to, starting from 0.
1146 * If negative, the last page will be used. If greater
1147 * than the number of pages in the notebook, nothing
1150 public void setCurrentPage(int pageNum
)
1152 // void gtk_notebook_set_current_page (GtkNotebook *notebook, gint page_num);
1153 gtk_notebook_set_current_page(gtkNotebook
, pageNum
);
1157 * Sets an group identificator for notebook, notebooks sharing
1158 * the same group identificator will be able to exchange tabs
1159 * via drag and drop. A notebook with group identificator -1 will
1160 * not be able to exchange tabs with any other notebook.
1164 * a group identificator, or -1 to unset it
1167 public void setGroupId(int groupId
)
1169 // void gtk_notebook_set_group_id (GtkNotebook *notebook, gint group_id);
1170 gtk_notebook_set_group_id(gtkNotebook
, groupId
);
1174 * Gets the current group identificator for notebook.
1178 * the group identificator, or -1 if none is set.
1181 public int getGroupId()
1183 // gint gtk_notebook_get_group_id (GtkNotebook *notebook);
1184 return gtk_notebook_get_group_id(gtkNotebook
);
1189 * Installs a global function used to create a window
1190 * when a detached tab is dropped in an empty area.
1192 * the GtkNotebookWindowCreationFunc, or NULL
1194 * user data for func
1196 * Destroy notifier for data, or NULL
1199 * The "enable-popup" property
1200 * "enable-popup" gboolean : Read / Write
1201 * If TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page.
1202 * Default value: FALSE
1204 public static void setWindowCreationHook(GtkNotebookWindowCreationFunc func
, void* data
, GDestroyNotify destroy
)
1206 // void gtk_notebook_set_window_creation_hook (GtkNotebookWindowCreationFunc func, gpointer data, GDestroyNotify destroy);
1207 gtk_notebook_set_window_creation_hook(func
, data
, destroy
);