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