1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.Notebook;
26 
27 private import glib.ConstructionException;
28 private import glib.Str;
29 private import gobject.ObjectG;
30 private import gobject.Signals;
31 private import gtk.Container;
32 private import gtk.Label;
33 private import gtk.Widget;
34 public  import gtkc.gdktypes;
35 private import gtkc.gtk;
36 public  import gtkc.gtktypes;
37 
38 
39 /**
40  * The #GtkNotebook widget is a #GtkContainer whose children are pages that
41  * can be switched between using tab labels along one edge.
42  * 
43  * There are many configuration options for GtkNotebook. Among other
44  * things, you can choose on which edge the tabs appear
45  * (see gtk_notebook_set_tab_pos()), whether, if there are too many
46  * tabs to fit the notebook should be made bigger or scrolling
47  * arrows added (see gtk_notebook_set_scrollable()), and whether there
48  * will be a popup menu allowing the users to switch pages.
49  * (see gtk_notebook_popup_enable(), gtk_notebook_popup_disable())
50  * 
51  * # GtkNotebook as GtkBuildable
52  * 
53  * The GtkNotebook implementation of the #GtkBuildable interface
54  * supports placing children into tabs by specifying “tab” as the
55  * “type” attribute of a <child> element. Note that the content
56  * of the tab must be created before the tab can be filled.
57  * A tab child can be specified without specifying a <child>
58  * type attribute.
59  * 
60  * To add a child widget in the notebooks action area, specify
61  * "action-start" or “action-end” as the “type” attribute of the
62  * <child> element.
63  * 
64  * An example of a UI definition fragment with GtkNotebook:
65  * |[
66  * <object class="GtkNotebook">
67  * <child>
68  * <object class="GtkLabel" id="notebook-content">
69  * <property name="label">Content</property>
70  * </object>
71  * </child>
72  * <child type="tab">
73  * <object class="GtkLabel" id="notebook-tab">
74  * <property name="label">Tab</property>
75  * </object>
76  * </child>
77  * </object>
78  * ]|
79  */
80 public class Notebook : Container
81 {
82 	/** the main Gtk struct */
83 	protected GtkNotebook* gtkNotebook;
84 
85 	/** Get the main Gtk struct */
86 	public GtkNotebook* getNotebookStruct()
87 	{
88 		return gtkNotebook;
89 	}
90 
91 	/** the main Gtk struct as a void* */
92 	protected override void* getStruct()
93 	{
94 		return cast(void*)gtkNotebook;
95 	}
96 
97 	protected override void setStruct(GObject* obj)
98 	{
99 		gtkNotebook = cast(GtkNotebook*)obj;
100 		super.setStruct(obj);
101 	}
102 
103 	/**
104 	 * Sets our main struct and passes it to the parent class.
105 	 */
106 	public this (GtkNotebook* gtkNotebook, bool ownedRef = false)
107 	{
108 		this.gtkNotebook = gtkNotebook;
109 		super(cast(GtkContainer*)gtkNotebook, ownedRef);
110 	}
111 
112 	/**
113 	 * Append a page with a widget and a text for a label
114 	 */
115 	public int appendPage(Widget child, string tabLabel)
116 	{
117 		return appendPage(child, new Label(tabLabel));
118 	}
119 	
120 	/** */
121 	void setCurrentPage(Widget child)
122 	{
123 		gtk_notebook_set_current_page(gtkNotebook,gtk_notebook_page_num(gtkNotebook, child.getWidgetStruct()));
124 	}
125 
126 	/**
127 	 */
128 
129 	/** */
130 	public static GType getType()
131 	{
132 		return gtk_notebook_get_type();
133 	}
134 
135 	/**
136 	 * Creates a new #GtkNotebook widget with no pages.
137 	 *
138 	 * Return: the newly created #GtkNotebook
139 	 *
140 	 * Throws: ConstructionException GTK+ fails to create the object.
141 	 */
142 	public this()
143 	{
144 		auto p = gtk_notebook_new();
145 		
146 		if(p is null)
147 		{
148 			throw new ConstructionException("null returned by new");
149 		}
150 		
151 		this(cast(GtkNotebook*) p);
152 	}
153 
154 	/**
155 	 * Appends a page to @notebook.
156 	 *
157 	 * Params:
158 	 *     child = the #GtkWidget to use as the contents of the page
159 	 *     tabLabel = the #GtkWidget to be used as the label
160 	 *         for the page, or %NULL to use the default label, “page N”
161 	 *
162 	 * Return: the index (starting from 0) of the appended
163 	 *     page in the notebook, or -1 if function fails
164 	 */
165 	public int appendPage(Widget child, Widget tabLabel)
166 	{
167 		return gtk_notebook_append_page(gtkNotebook, (child is null) ? null : child.getWidgetStruct(), (tabLabel is null) ? null : tabLabel.getWidgetStruct());
168 	}
169 
170 	/**
171 	 * Appends a page to @notebook, specifying the widget to use as the
172 	 * label in the popup menu.
173 	 *
174 	 * Params:
175 	 *     child = the #GtkWidget to use as the contents of the page
176 	 *     tabLabel = the #GtkWidget to be used as the label
177 	 *         for the page, or %NULL to use the default label, “page N”
178 	 *     menuLabel = the widget to use as a label for the
179 	 *         page-switch menu, if that is enabled. If %NULL, and @tab_label
180 	 *         is a #GtkLabel or %NULL, then the menu label will be a newly
181 	 *         created label with the same text as @tab_label; if @tab_label
182 	 *         is not a #GtkLabel, @menu_label must be specified if the
183 	 *         page-switch menu is to be used.
184 	 *
185 	 * Return: the index (starting from 0) of the appended
186 	 *     page in the notebook, or -1 if function fails
187 	 */
188 	public int appendPageMenu(Widget child, Widget tabLabel, Widget menuLabel)
189 	{
190 		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());
191 	}
192 
193 	/**
194 	 * Removes the child from the notebook.
195 	 *
196 	 * This function is very similar to gtk_container_remove(),
197 	 * but additionally informs the notebook that the removal
198 	 * is happening as part of a tab DND operation, which should
199 	 * not be cancelled.
200 	 *
201 	 * Params:
202 	 *     child = a child
203 	 *
204 	 * Since: 3.16
205 	 */
206 	public void detachTab(Widget child)
207 	{
208 		gtk_notebook_detach_tab(gtkNotebook, (child is null) ? null : child.getWidgetStruct());
209 	}
210 
211 	/**
212 	 * Gets one of the action widgets. See gtk_notebook_set_action_widget().
213 	 *
214 	 * Params:
215 	 *     packType = pack type of the action widget to receive
216 	 *
217 	 * Return: The action widget with the given @pack_type
218 	 *     or %NULL when this action widget has not been set
219 	 *
220 	 * Since: 2.20
221 	 */
222 	public Widget getActionWidget(GtkPackType packType)
223 	{
224 		auto p = gtk_notebook_get_action_widget(gtkNotebook, packType);
225 		
226 		if(p is null)
227 		{
228 			return null;
229 		}
230 		
231 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
232 	}
233 
234 	/**
235 	 * Returns the page number of the current page.
236 	 *
237 	 * Return: the index (starting from 0) of the current
238 	 *     page in the notebook. If the notebook has no pages,
239 	 *     then -1 will be returned.
240 	 */
241 	public int getCurrentPage()
242 	{
243 		return gtk_notebook_get_current_page(gtkNotebook);
244 	}
245 
246 	/**
247 	 * Gets the current group name for @notebook.
248 	 *
249 	 * Return: the group name,
250 	 *     or %NULL if none is set.
251 	 *
252 	 * Since: 2.24
253 	 */
254 	public string getGroupName()
255 	{
256 		return Str.toString(gtk_notebook_get_group_name(gtkNotebook));
257 	}
258 
259 	/**
260 	 * Retrieves the menu label widget of the page containing @child.
261 	 *
262 	 * Params:
263 	 *     child = a widget contained in a page of @notebook
264 	 *
265 	 * Return: the menu label, or %NULL if the
266 	 *     notebook page does not have a menu label other than the
267 	 *     default (the tab label).
268 	 */
269 	public Widget getMenuLabel(Widget child)
270 	{
271 		auto p = gtk_notebook_get_menu_label(gtkNotebook, (child is null) ? null : child.getWidgetStruct());
272 		
273 		if(p is null)
274 		{
275 			return null;
276 		}
277 		
278 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
279 	}
280 
281 	/**
282 	 * Retrieves the text of the menu label for the page containing
283 	 * @child.
284 	 *
285 	 * Params:
286 	 *     child = the child widget of a page of the notebook.
287 	 *
288 	 * Return: the text of the tab label, or %NULL if the
289 	 *     widget does not have a menu label other than the default
290 	 *     menu label, or the menu label widget is not a #GtkLabel.
291 	 *     The string is owned by the widget and must not be freed.
292 	 */
293 	public string getMenuLabelText(Widget child)
294 	{
295 		return Str.toString(gtk_notebook_get_menu_label_text(gtkNotebook, (child is null) ? null : child.getWidgetStruct()));
296 	}
297 
298 	/**
299 	 * Gets the number of pages in a notebook.
300 	 *
301 	 * Return: the number of pages in the notebook
302 	 *
303 	 * Since: 2.2
304 	 */
305 	public int getNPages()
306 	{
307 		return gtk_notebook_get_n_pages(gtkNotebook);
308 	}
309 
310 	/**
311 	 * Returns the child widget contained in page number @page_num.
312 	 *
313 	 * Params:
314 	 *     pageNum = the index of a page in the notebook, or -1
315 	 *         to get the last page
316 	 *
317 	 * Return: the child widget, or %NULL
318 	 *     if @page_num is out of bounds
319 	 */
320 	public Widget getNthPage(int pageNum)
321 	{
322 		auto p = gtk_notebook_get_nth_page(gtkNotebook, pageNum);
323 		
324 		if(p is null)
325 		{
326 			return null;
327 		}
328 		
329 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
330 	}
331 
332 	/**
333 	 * Returns whether the tab label area has arrows for scrolling.
334 	 * See gtk_notebook_set_scrollable().
335 	 *
336 	 * Return: %TRUE if arrows for scrolling are present
337 	 */
338 	public bool getScrollable()
339 	{
340 		return gtk_notebook_get_scrollable(gtkNotebook) != 0;
341 	}
342 
343 	/**
344 	 * Returns whether a bevel will be drawn around the notebook pages.
345 	 * See gtk_notebook_set_show_border().
346 	 *
347 	 * Return: %TRUE if the bevel is drawn
348 	 */
349 	public bool getShowBorder()
350 	{
351 		return gtk_notebook_get_show_border(gtkNotebook) != 0;
352 	}
353 
354 	/**
355 	 * Returns whether the tabs of the notebook are shown.
356 	 * See gtk_notebook_set_show_tabs().
357 	 *
358 	 * Return: %TRUE if the tabs are shown
359 	 */
360 	public bool getShowTabs()
361 	{
362 		return gtk_notebook_get_show_tabs(gtkNotebook) != 0;
363 	}
364 
365 	/**
366 	 * Returns whether the tab contents can be detached from @notebook.
367 	 *
368 	 * Params:
369 	 *     child = a child #GtkWidget
370 	 *
371 	 * Return: %TRUE if the tab is detachable.
372 	 *
373 	 * Since: 2.10
374 	 */
375 	public bool getTabDetachable(Widget child)
376 	{
377 		return gtk_notebook_get_tab_detachable(gtkNotebook, (child is null) ? null : child.getWidgetStruct()) != 0;
378 	}
379 
380 	/**
381 	 * Returns the horizontal width of a tab border.
382 	 *
383 	 * Deprecated: this function returns zero
384 	 *
385 	 * Return: horizontal width of a tab border
386 	 *
387 	 * Since: 2.22
388 	 */
389 	public ushort getTabHborder()
390 	{
391 		return gtk_notebook_get_tab_hborder(gtkNotebook);
392 	}
393 
394 	/**
395 	 * Returns the tab label widget for the page @child.
396 	 * %NULL is returned if @child is not in @notebook or
397 	 * if no tab label has specifically been set for @child.
398 	 *
399 	 * Params:
400 	 *     child = the page
401 	 *
402 	 * Return: the tab label
403 	 */
404 	public Widget getTabLabel(Widget child)
405 	{
406 		auto p = gtk_notebook_get_tab_label(gtkNotebook, (child is null) ? null : child.getWidgetStruct());
407 		
408 		if(p is null)
409 		{
410 			return null;
411 		}
412 		
413 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
414 	}
415 
416 	/**
417 	 * Retrieves the text of the tab label for the page containing
418 	 * @child.
419 	 *
420 	 * Params:
421 	 *     child = a widget contained in a page of @notebook
422 	 *
423 	 * Return: the text of the tab label, or %NULL if the
424 	 *     tab label widget is not a #GtkLabel. The string is owned
425 	 *     by the widget and must not be freed.
426 	 */
427 	public string getTabLabelText(Widget child)
428 	{
429 		return Str.toString(gtk_notebook_get_tab_label_text(gtkNotebook, (child is null) ? null : child.getWidgetStruct()));
430 	}
431 
432 	/**
433 	 * Gets the edge at which the tabs for switching pages in the
434 	 * notebook are drawn.
435 	 *
436 	 * Return: the edge at which the tabs are drawn
437 	 */
438 	public GtkPositionType getTabPos()
439 	{
440 		return gtk_notebook_get_tab_pos(gtkNotebook);
441 	}
442 
443 	/**
444 	 * Gets whether the tab can be reordered via drag and drop or not.
445 	 *
446 	 * Params:
447 	 *     child = a child #GtkWidget
448 	 *
449 	 * Return: %TRUE if the tab is reorderable.
450 	 *
451 	 * Since: 2.10
452 	 */
453 	public bool getTabReorderable(Widget child)
454 	{
455 		return gtk_notebook_get_tab_reorderable(gtkNotebook, (child is null) ? null : child.getWidgetStruct()) != 0;
456 	}
457 
458 	/**
459 	 * Returns the vertical width of a tab border.
460 	 *
461 	 * Deprecated: this function returns zero
462 	 *
463 	 * Return: vertical width of a tab border
464 	 *
465 	 * Since: 2.22
466 	 */
467 	public ushort getTabVborder()
468 	{
469 		return gtk_notebook_get_tab_vborder(gtkNotebook);
470 	}
471 
472 	/**
473 	 * Insert a page into @notebook at the given position.
474 	 *
475 	 * Params:
476 	 *     child = the #GtkWidget to use as the contents of the page
477 	 *     tabLabel = the #GtkWidget to be used as the label
478 	 *         for the page, or %NULL to use the default label, “page N”
479 	 *     position = the index (starting at 0) at which to insert the page,
480 	 *         or -1 to append the page after all other pages
481 	 *
482 	 * Return: the index (starting from 0) of the inserted
483 	 *     page in the notebook, or -1 if function fails
484 	 */
485 	public int insertPage(Widget child, Widget tabLabel, int position)
486 	{
487 		return gtk_notebook_insert_page(gtkNotebook, (child is null) ? null : child.getWidgetStruct(), (tabLabel is null) ? null : tabLabel.getWidgetStruct(), position);
488 	}
489 
490 	/**
491 	 * Insert a page into @notebook at the given position, specifying
492 	 * the widget to use as the label in the popup menu.
493 	 *
494 	 * Params:
495 	 *     child = the #GtkWidget to use as the contents of the page
496 	 *     tabLabel = the #GtkWidget to be used as the label
497 	 *         for the page, or %NULL to use the default label, “page N”
498 	 *     menuLabel = the widget to use as a label for the
499 	 *         page-switch menu, if that is enabled. If %NULL, and @tab_label
500 	 *         is a #GtkLabel or %NULL, then the menu label will be a newly
501 	 *         created label with the same text as @tab_label; if @tab_label
502 	 *         is not a #GtkLabel, @menu_label must be specified if the
503 	 *         page-switch menu is to be used.
504 	 *     position = the index (starting at 0) at which to insert the page,
505 	 *         or -1 to append the page after all other pages.
506 	 *
507 	 * Return: the index (starting from 0) of the inserted
508 	 *     page in the notebook
509 	 */
510 	public int insertPageMenu(Widget child, Widget tabLabel, Widget menuLabel, int position)
511 	{
512 		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);
513 	}
514 
515 	/**
516 	 * Switches to the next page. Nothing happens if the current page is
517 	 * the last page.
518 	 */
519 	public void nextPage()
520 	{
521 		gtk_notebook_next_page(gtkNotebook);
522 	}
523 
524 	/**
525 	 * Finds the index of the page which contains the given child
526 	 * widget.
527 	 *
528 	 * Params:
529 	 *     child = a #GtkWidget
530 	 *
531 	 * Return: the index of the page containing @child, or
532 	 *     -1 if @child is not in the notebook
533 	 */
534 	public int pageNum(Widget child)
535 	{
536 		return gtk_notebook_page_num(gtkNotebook, (child is null) ? null : child.getWidgetStruct());
537 	}
538 
539 	/**
540 	 * Disables the popup menu.
541 	 */
542 	public void popupDisable()
543 	{
544 		gtk_notebook_popup_disable(gtkNotebook);
545 	}
546 
547 	/**
548 	 * Enables the popup menu: if the user clicks with the right
549 	 * mouse button on the tab labels, a menu with all the pages
550 	 * will be popped up.
551 	 */
552 	public void popupEnable()
553 	{
554 		gtk_notebook_popup_enable(gtkNotebook);
555 	}
556 
557 	/**
558 	 * Prepends a page to @notebook.
559 	 *
560 	 * Params:
561 	 *     child = the #GtkWidget to use as the contents of the page
562 	 *     tabLabel = the #GtkWidget to be used as the label
563 	 *         for the page, or %NULL to use the default label, “page N”
564 	 *
565 	 * Return: the index (starting from 0) of the prepended
566 	 *     page in the notebook, or -1 if function fails
567 	 */
568 	public int prependPage(Widget child, Widget tabLabel)
569 	{
570 		return gtk_notebook_prepend_page(gtkNotebook, (child is null) ? null : child.getWidgetStruct(), (tabLabel is null) ? null : tabLabel.getWidgetStruct());
571 	}
572 
573 	/**
574 	 * Prepends a page to @notebook, specifying the widget to use as the
575 	 * label in the popup menu.
576 	 *
577 	 * Params:
578 	 *     child = the #GtkWidget to use as the contents of the page
579 	 *     tabLabel = the #GtkWidget to be used as the label
580 	 *         for the page, or %NULL to use the default label, “page N”
581 	 *     menuLabel = the widget to use as a label for the
582 	 *         page-switch menu, if that is enabled. If %NULL, and @tab_label
583 	 *         is a #GtkLabel or %NULL, then the menu label will be a newly
584 	 *         created label with the same text as @tab_label; if @tab_label
585 	 *         is not a #GtkLabel, @menu_label must be specified if the
586 	 *         page-switch menu is to be used.
587 	 *
588 	 * Return: the index (starting from 0) of the prepended
589 	 *     page in the notebook, or -1 if function fails
590 	 */
591 	public int prependPageMenu(Widget child, Widget tabLabel, Widget menuLabel)
592 	{
593 		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());
594 	}
595 
596 	/**
597 	 * Switches to the previous page. Nothing happens if the current page
598 	 * is the first page.
599 	 */
600 	public void prevPage()
601 	{
602 		gtk_notebook_prev_page(gtkNotebook);
603 	}
604 
605 	/**
606 	 * Removes a page from the notebook given its index
607 	 * in the notebook.
608 	 *
609 	 * Params:
610 	 *     pageNum = the index of a notebook page, starting
611 	 *         from 0. If -1, the last page will be removed.
612 	 */
613 	public void removePage(int pageNum)
614 	{
615 		gtk_notebook_remove_page(gtkNotebook, pageNum);
616 	}
617 
618 	/**
619 	 * Reorders the page containing @child, so that it appears in position
620 	 * @position. If @position is greater than or equal to the number of
621 	 * children in the list or negative, @child will be moved to the end
622 	 * of the list.
623 	 *
624 	 * Params:
625 	 *     child = the child to move
626 	 *     position = the new position, or -1 to move to the end
627 	 */
628 	public void reorderChild(Widget child, int position)
629 	{
630 		gtk_notebook_reorder_child(gtkNotebook, (child is null) ? null : child.getWidgetStruct(), position);
631 	}
632 
633 	/**
634 	 * Sets @widget as one of the action widgets. Depending on the pack type
635 	 * the widget will be placed before or after the tabs. You can use
636 	 * a #GtkBox if you need to pack more than one widget on the same side.
637 	 *
638 	 * Note that action widgets are “internal” children of the notebook and thus
639 	 * not included in the list returned from gtk_container_foreach().
640 	 *
641 	 * Params:
642 	 *     widget = a #GtkWidget
643 	 *     packType = pack type of the action widget
644 	 *
645 	 * Since: 2.20
646 	 */
647 	public void setActionWidget(Widget widget, GtkPackType packType)
648 	{
649 		gtk_notebook_set_action_widget(gtkNotebook, (widget is null) ? null : widget.getWidgetStruct(), packType);
650 	}
651 
652 	/**
653 	 * Switches to the page number @page_num.
654 	 *
655 	 * Note that due to historical reasons, GtkNotebook refuses
656 	 * to switch to a page unless the child widget is visible.
657 	 * Therefore, it is recommended to show child widgets before
658 	 * adding them to a notebook.
659 	 *
660 	 * Params:
661 	 *     pageNum = index of the page to switch to, starting from 0.
662 	 *         If negative, the last page will be used. If greater
663 	 *         than the number of pages in the notebook, nothing
664 	 *         will be done.
665 	 */
666 	public void setCurrentPage(int pageNum)
667 	{
668 		gtk_notebook_set_current_page(gtkNotebook, pageNum);
669 	}
670 
671 	/**
672 	 * Sets a group name for @notebook.
673 	 *
674 	 * Notebooks with the same name will be able to exchange tabs
675 	 * via drag and drop. A notebook with a %NULL group name will
676 	 * not be able to exchange tabs with any other notebook.
677 	 *
678 	 * Params:
679 	 *     groupName = the name of the notebook group,
680 	 *         or %NULL to unset it
681 	 *
682 	 * Since: 2.24
683 	 */
684 	public void setGroupName(string groupName)
685 	{
686 		gtk_notebook_set_group_name(gtkNotebook, Str.toStringz(groupName));
687 	}
688 
689 	/**
690 	 * Changes the menu label for the page containing @child.
691 	 *
692 	 * Params:
693 	 *     child = the child widget
694 	 *     menuLabel = the menu label, or %NULL for default
695 	 */
696 	public void setMenuLabel(Widget child, Widget menuLabel)
697 	{
698 		gtk_notebook_set_menu_label(gtkNotebook, (child is null) ? null : child.getWidgetStruct(), (menuLabel is null) ? null : menuLabel.getWidgetStruct());
699 	}
700 
701 	/**
702 	 * Creates a new label and sets it as the menu label of @child.
703 	 *
704 	 * Params:
705 	 *     child = the child widget
706 	 *     menuText = the label text
707 	 */
708 	public void setMenuLabelText(Widget child, string menuText)
709 	{
710 		gtk_notebook_set_menu_label_text(gtkNotebook, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(menuText));
711 	}
712 
713 	/**
714 	 * Sets whether the tab label area will have arrows for
715 	 * scrolling if there are too many tabs to fit in the area.
716 	 *
717 	 * Params:
718 	 *     scrollable = %TRUE if scroll arrows should be added
719 	 */
720 	public void setScrollable(bool scrollable)
721 	{
722 		gtk_notebook_set_scrollable(gtkNotebook, scrollable);
723 	}
724 
725 	/**
726 	 * Sets whether a bevel will be drawn around the notebook pages.
727 	 * This only has a visual effect when the tabs are not shown.
728 	 * See gtk_notebook_set_show_tabs().
729 	 *
730 	 * Params:
731 	 *     showBorder = %TRUE if a bevel should be drawn around the notebook
732 	 */
733 	public void setShowBorder(bool showBorder)
734 	{
735 		gtk_notebook_set_show_border(gtkNotebook, showBorder);
736 	}
737 
738 	/**
739 	 * Sets whether to show the tabs for the notebook or not.
740 	 *
741 	 * Params:
742 	 *     showTabs = %TRUE if the tabs should be shown
743 	 */
744 	public void setShowTabs(bool showTabs)
745 	{
746 		gtk_notebook_set_show_tabs(gtkNotebook, showTabs);
747 	}
748 
749 	/**
750 	 * Sets whether the tab can be detached from @notebook to another
751 	 * notebook or widget.
752 	 *
753 	 * Note that 2 notebooks must share a common group identificator
754 	 * (see gtk_notebook_set_group_name()) to allow automatic tabs
755 	 * interchange between them.
756 	 *
757 	 * If you want a widget to interact with a notebook through DnD
758 	 * (i.e.: accept dragged tabs from it) it must be set as a drop
759 	 * destination and accept the target “GTK_NOTEBOOK_TAB”. The notebook
760 	 * will fill the selection with a GtkWidget** pointing to the child
761 	 * widget that corresponds to the dropped tab.
762 	 *
763 	 * Note that you should use gtk_notebook_detach_tab() instead
764 	 * of gtk_container_remove() if you want to remove the tab from
765 	 * the source notebook as part of accepting a drop. Otherwise,
766 	 * the source notebook will think that the dragged tab was
767 	 * removed from underneath the ongoing drag operation, and
768 	 * will initiate a drag cancel animation.
769 	 *
770 	 * |[<!-- language="C" -->
771 	 * static void
772 	 * on_drag_data_received (GtkWidget        *widget,
773 	 * GdkDragContext   *context,
774 	 * gint              x,
775 	 * gint              y,
776 	 * GtkSelectionData *data,
777 	 * guint             info,
778 	 * guint             time,
779 	 * gpointer          user_data)
780 	 * {
781 	 * GtkWidget *notebook;
782 	 * GtkWidget **child;
783 	 *
784 	 * notebook = gtk_drag_get_source_widget (context);
785 	 * child = (void*) gtk_selection_data_get_data (data);
786 	 *
787 	 * process_widget (*child);
788 	 * gtk_notebook_detach_tab (GTK_NOTEBOOK (notebook), *child);
789 	 * }
790 	 * ]|
791 	 *
792 	 * If you want a notebook to accept drags from other widgets,
793 	 * you will have to set your own DnD code to do it.
794 	 *
795 	 * Params:
796 	 *     child = a child #GtkWidget
797 	 *     detachable = whether the tab is detachable or not
798 	 *
799 	 * Since: 2.10
800 	 */
801 	public void setTabDetachable(Widget child, bool detachable)
802 	{
803 		gtk_notebook_set_tab_detachable(gtkNotebook, (child is null) ? null : child.getWidgetStruct(), detachable);
804 	}
805 
806 	/**
807 	 * Changes the tab label for @child.
808 	 * If %NULL is specified for @tab_label, then the page will
809 	 * have the label “page N”.
810 	 *
811 	 * Params:
812 	 *     child = the page
813 	 *     tabLabel = the tab label widget to use, or %NULL
814 	 *         for default tab label
815 	 */
816 	public void setTabLabel(Widget child, Widget tabLabel)
817 	{
818 		gtk_notebook_set_tab_label(gtkNotebook, (child is null) ? null : child.getWidgetStruct(), (tabLabel is null) ? null : tabLabel.getWidgetStruct());
819 	}
820 
821 	/**
822 	 * Creates a new label and sets it as the tab label for the page
823 	 * containing @child.
824 	 *
825 	 * Params:
826 	 *     child = the page
827 	 *     tabText = the label text
828 	 */
829 	public void setTabLabelText(Widget child, string tabText)
830 	{
831 		gtk_notebook_set_tab_label_text(gtkNotebook, (child is null) ? null : child.getWidgetStruct(), Str.toStringz(tabText));
832 	}
833 
834 	/**
835 	 * Sets the edge at which the tabs for switching pages in the
836 	 * notebook are drawn.
837 	 *
838 	 * Params:
839 	 *     pos = the edge to draw the tabs at
840 	 */
841 	public void setTabPos(GtkPositionType pos)
842 	{
843 		gtk_notebook_set_tab_pos(gtkNotebook, pos);
844 	}
845 
846 	/**
847 	 * Sets whether the notebook tab can be reordered
848 	 * via drag and drop or not.
849 	 *
850 	 * Params:
851 	 *     child = a child #GtkWidget
852 	 *     reorderable = whether the tab is reorderable or not
853 	 *
854 	 * Since: 2.10
855 	 */
856 	public void setTabReorderable(Widget child, bool reorderable)
857 	{
858 		gtk_notebook_set_tab_reorderable(gtkNotebook, (child is null) ? null : child.getWidgetStruct(), reorderable);
859 	}
860 
861 	int[string] connectedSignals;
862 
863 	bool delegate(int, Notebook)[] onChangeCurrentPageListeners;
864 	/** */
865 	void addOnChangeCurrentPage(bool delegate(int, Notebook) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
866 	{
867 		if ( "change-current-page" !in connectedSignals )
868 		{
869 			Signals.connectData(
870 				this,
871 				"change-current-page",
872 				cast(GCallback)&callBackChangeCurrentPage,
873 				cast(void*)this,
874 				null,
875 				connectFlags);
876 			connectedSignals["change-current-page"] = 1;
877 		}
878 		onChangeCurrentPageListeners ~= dlg;
879 	}
880 	extern(C) static int callBackChangeCurrentPage(GtkNotebook* notebookStruct, int object, Notebook _notebook)
881 	{
882 		foreach ( bool delegate(int, Notebook) dlg; _notebook.onChangeCurrentPageListeners )
883 		{
884 			if ( dlg(object, _notebook) )
885 			{
886 				return 1;
887 			}
888 		}
889 		
890 		return 0;
891 	}
892 
893 	Notebook delegate(Widget, int, int, Notebook)[] onCreateWindowListeners;
894 	/**
895 	 * The ::create-window signal is emitted when a detachable
896 	 * tab is dropped on the root window.
897 	 *
898 	 * A handler for this signal can create a window containing
899 	 * a notebook where the tab will be attached. It is also
900 	 * responsible for moving/resizing the window and adding the
901 	 * necessary properties to the notebook (e.g. the
902 	 * #GtkNotebook:group-name ).
903 	 *
904 	 * Params:
905 	 *     page = the tab of @notebook that is being detached
906 	 *     x = the X coordinate where the drop happens
907 	 *     y = the Y coordinate where the drop happens
908 	 *
909 	 * Return: a #GtkNotebook that @page should be
910 	 *     added to, or %NULL.
911 	 *
912 	 * Since: 2.12
913 	 */
914 	void addOnCreateWindow(Notebook delegate(Widget, int, int, Notebook) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
915 	{
916 		if ( "create-window" !in connectedSignals )
917 		{
918 			Signals.connectData(
919 				this,
920 				"create-window",
921 				cast(GCallback)&callBackCreateWindow,
922 				cast(void*)this,
923 				null,
924 				connectFlags);
925 			connectedSignals["create-window"] = 1;
926 		}
927 		onCreateWindowListeners ~= dlg;
928 	}
929 	extern(C) static GtkNotebook* callBackCreateWindow(GtkNotebook* notebookStruct, GtkWidget* page, int x, int y, Notebook _notebook)
930 	{
931 		foreach ( Notebook delegate(Widget, int, int, Notebook) dlg; _notebook.onCreateWindowListeners )
932 		{
933 			if ( auto r = dlg(ObjectG.getDObject!(Widget)(page), x, y, _notebook) )
934 				return r.getNotebookStruct();
935 		}
936 		
937 		return null;
938 	}
939 
940 	bool delegate(GtkNotebookTab, Notebook)[] onFocusTabListeners;
941 	/** */
942 	void addOnFocusTab(bool delegate(GtkNotebookTab, Notebook) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
943 	{
944 		if ( "focus-tab" !in connectedSignals )
945 		{
946 			Signals.connectData(
947 				this,
948 				"focus-tab",
949 				cast(GCallback)&callBackFocusTab,
950 				cast(void*)this,
951 				null,
952 				connectFlags);
953 			connectedSignals["focus-tab"] = 1;
954 		}
955 		onFocusTabListeners ~= dlg;
956 	}
957 	extern(C) static int callBackFocusTab(GtkNotebook* notebookStruct, GtkNotebookTab object, Notebook _notebook)
958 	{
959 		foreach ( bool delegate(GtkNotebookTab, Notebook) dlg; _notebook.onFocusTabListeners )
960 		{
961 			if ( dlg(object, _notebook) )
962 			{
963 				return 1;
964 			}
965 		}
966 		
967 		return 0;
968 	}
969 
970 	void delegate(GtkDirectionType, Notebook)[] onMoveFocusOutListeners;
971 	/** */
972 	void addOnMoveFocusOut(void delegate(GtkDirectionType, Notebook) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
973 	{
974 		if ( "move-focus-out" !in connectedSignals )
975 		{
976 			Signals.connectData(
977 				this,
978 				"move-focus-out",
979 				cast(GCallback)&callBackMoveFocusOut,
980 				cast(void*)this,
981 				null,
982 				connectFlags);
983 			connectedSignals["move-focus-out"] = 1;
984 		}
985 		onMoveFocusOutListeners ~= dlg;
986 	}
987 	extern(C) static void callBackMoveFocusOut(GtkNotebook* notebookStruct, GtkDirectionType object, Notebook _notebook)
988 	{
989 		foreach ( void delegate(GtkDirectionType, Notebook) dlg; _notebook.onMoveFocusOutListeners )
990 		{
991 			dlg(object, _notebook);
992 		}
993 	}
994 
995 	void delegate(Widget, uint, Notebook)[] onPageAddedListeners;
996 	/**
997 	 * the ::page-added signal is emitted in the notebook
998 	 * right after a page is added to the notebook.
999 	 *
1000 	 * Params:
1001 	 *     child = the child #GtkWidget affected
1002 	 *     pageNum = the new page number for @child
1003 	 *
1004 	 * Since: 2.10
1005 	 */
1006 	void addOnPageAdded(void delegate(Widget, uint, Notebook) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1007 	{
1008 		if ( "page-added" !in connectedSignals )
1009 		{
1010 			Signals.connectData(
1011 				this,
1012 				"page-added",
1013 				cast(GCallback)&callBackPageAdded,
1014 				cast(void*)this,
1015 				null,
1016 				connectFlags);
1017 			connectedSignals["page-added"] = 1;
1018 		}
1019 		onPageAddedListeners ~= dlg;
1020 	}
1021 	extern(C) static void callBackPageAdded(GtkNotebook* notebookStruct, GtkWidget* child, uint pageNum, Notebook _notebook)
1022 	{
1023 		foreach ( void delegate(Widget, uint, Notebook) dlg; _notebook.onPageAddedListeners )
1024 		{
1025 			dlg(ObjectG.getDObject!(Widget)(child), pageNum, _notebook);
1026 		}
1027 	}
1028 
1029 	void delegate(Widget, uint, Notebook)[] onPageRemovedListeners;
1030 	/**
1031 	 * the ::page-removed signal is emitted in the notebook
1032 	 * right after a page is removed from the notebook.
1033 	 *
1034 	 * Params:
1035 	 *     child = the child #GtkWidget affected
1036 	 *     pageNum = the @child page number
1037 	 *
1038 	 * Since: 2.10
1039 	 */
1040 	void addOnPageRemoved(void delegate(Widget, uint, Notebook) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1041 	{
1042 		if ( "page-removed" !in connectedSignals )
1043 		{
1044 			Signals.connectData(
1045 				this,
1046 				"page-removed",
1047 				cast(GCallback)&callBackPageRemoved,
1048 				cast(void*)this,
1049 				null,
1050 				connectFlags);
1051 			connectedSignals["page-removed"] = 1;
1052 		}
1053 		onPageRemovedListeners ~= dlg;
1054 	}
1055 	extern(C) static void callBackPageRemoved(GtkNotebook* notebookStruct, GtkWidget* child, uint pageNum, Notebook _notebook)
1056 	{
1057 		foreach ( void delegate(Widget, uint, Notebook) dlg; _notebook.onPageRemovedListeners )
1058 		{
1059 			dlg(ObjectG.getDObject!(Widget)(child), pageNum, _notebook);
1060 		}
1061 	}
1062 
1063 	void delegate(Widget, uint, Notebook)[] onPageReorderedListeners;
1064 	/**
1065 	 * the ::page-reordered signal is emitted in the notebook
1066 	 * right after a page has been reordered.
1067 	 *
1068 	 * Params:
1069 	 *     child = the child #GtkWidget affected
1070 	 *     pageNum = the new page number for @child
1071 	 *
1072 	 * Since: 2.10
1073 	 */
1074 	void addOnPageReordered(void delegate(Widget, uint, Notebook) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1075 	{
1076 		if ( "page-reordered" !in connectedSignals )
1077 		{
1078 			Signals.connectData(
1079 				this,
1080 				"page-reordered",
1081 				cast(GCallback)&callBackPageReordered,
1082 				cast(void*)this,
1083 				null,
1084 				connectFlags);
1085 			connectedSignals["page-reordered"] = 1;
1086 		}
1087 		onPageReorderedListeners ~= dlg;
1088 	}
1089 	extern(C) static void callBackPageReordered(GtkNotebook* notebookStruct, GtkWidget* child, uint pageNum, Notebook _notebook)
1090 	{
1091 		foreach ( void delegate(Widget, uint, Notebook) dlg; _notebook.onPageReorderedListeners )
1092 		{
1093 			dlg(ObjectG.getDObject!(Widget)(child), pageNum, _notebook);
1094 		}
1095 	}
1096 
1097 	bool delegate(GtkDirectionType, bool, Notebook)[] onReorderTabListeners;
1098 	/** */
1099 	void addOnReorderTab(bool delegate(GtkDirectionType, bool, Notebook) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1100 	{
1101 		if ( "reorder-tab" !in connectedSignals )
1102 		{
1103 			Signals.connectData(
1104 				this,
1105 				"reorder-tab",
1106 				cast(GCallback)&callBackReorderTab,
1107 				cast(void*)this,
1108 				null,
1109 				connectFlags);
1110 			connectedSignals["reorder-tab"] = 1;
1111 		}
1112 		onReorderTabListeners ~= dlg;
1113 	}
1114 	extern(C) static int callBackReorderTab(GtkNotebook* notebookStruct, GtkDirectionType object, bool p0, Notebook _notebook)
1115 	{
1116 		foreach ( bool delegate(GtkDirectionType, bool, Notebook) dlg; _notebook.onReorderTabListeners )
1117 		{
1118 			if ( dlg(object, p0, _notebook) )
1119 			{
1120 				return 1;
1121 			}
1122 		}
1123 		
1124 		return 0;
1125 	}
1126 
1127 	bool delegate(bool, Notebook)[] onSelectPageListeners;
1128 	/** */
1129 	void addOnSelectPage(bool delegate(bool, Notebook) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1130 	{
1131 		if ( "select-page" !in connectedSignals )
1132 		{
1133 			Signals.connectData(
1134 				this,
1135 				"select-page",
1136 				cast(GCallback)&callBackSelectPage,
1137 				cast(void*)this,
1138 				null,
1139 				connectFlags);
1140 			connectedSignals["select-page"] = 1;
1141 		}
1142 		onSelectPageListeners ~= dlg;
1143 	}
1144 	extern(C) static int callBackSelectPage(GtkNotebook* notebookStruct, bool object, Notebook _notebook)
1145 	{
1146 		foreach ( bool delegate(bool, Notebook) dlg; _notebook.onSelectPageListeners )
1147 		{
1148 			if ( dlg(object, _notebook) )
1149 			{
1150 				return 1;
1151 			}
1152 		}
1153 		
1154 		return 0;
1155 	}
1156 
1157 	void delegate(Widget, uint, Notebook)[] onSwitchPageListeners;
1158 	/**
1159 	 * Emitted when the user or a function changes the current page.
1160 	 *
1161 	 * Params:
1162 	 *     page = the new current page
1163 	 *     pageNum = the index of the page
1164 	 */
1165 	void addOnSwitchPage(void delegate(Widget, uint, Notebook) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1166 	{
1167 		if ( "switch-page" !in connectedSignals )
1168 		{
1169 			Signals.connectData(
1170 				this,
1171 				"switch-page",
1172 				cast(GCallback)&callBackSwitchPage,
1173 				cast(void*)this,
1174 				null,
1175 				connectFlags);
1176 			connectedSignals["switch-page"] = 1;
1177 		}
1178 		onSwitchPageListeners ~= dlg;
1179 	}
1180 	extern(C) static void callBackSwitchPage(GtkNotebook* notebookStruct, GtkWidget* page, uint pageNum, Notebook _notebook)
1181 	{
1182 		foreach ( void delegate(Widget, uint, Notebook) dlg; _notebook.onSwitchPageListeners )
1183 		{
1184 			dlg(ObjectG.getDObject!(Widget)(page), pageNum, _notebook);
1185 		}
1186 	}
1187 }