1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --               Copyright (C) 2000-2013, AdaCore                    -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  <description> 
  31. --  A Gtk_Notebook is a container that displays all of its children at the 
  32. --  same location on the screen. They are organized into pages, that can be 
  33. --  selected through tabs (either by clicking on them or by a contextual 
  34. --  menu). 
  35. --  This is the best way to organize complicated interfaces that have a lot 
  36. --  of widgets, by putting the children into groups of coherent widgets. 
  37. -- 
  38. --  You can hide some of the pages of the notebook by simply calling Hide on 
  39. --  the widget that is contained in the page (or returned from Get_Nth_Page). 
  40. --  </description> 
  41. --  <c_version>2.16.6</c_version> 
  42. --  <group>Layout containers</group> 
  43. --  <testgtk>create_notebook.adb</testgtk> 
  44. --  <screenshot>gtk-notebook</screenshot> 
  45.  
  46. with Glib.Glist; 
  47. pragma Elaborate_All (Glib.Glist); 
  48. with Glib.Properties; 
  49. with Glib.Values; 
  50. with Gtk.Container; 
  51. with Gtk.Enums; 
  52. with Gtk.Widget; 
  53. with Unchecked_Conversion; 
  54.  
  55. package Gtk.Notebook is 
  56.  
  57.    type Gtk_Notebook_Record is new Gtk.Container.Gtk_Container_Record 
  58.      with private; 
  59.    type Gtk_Notebook is access all Gtk_Notebook_Record'Class; 
  60.  
  61.    subtype Gtk_Notebook_Page is Gtk.Gtk_Notebook_Page; 
  62.  
  63.    type Gtk_Notebook_Tab is 
  64.      (Notebook_Tab_First, 
  65.       Notebook_Tab_Last); 
  66.    pragma Convention (C, Gtk_Notebook_Tab); 
  67.  
  68.    subtype Gtk_Notebook_Group is Glib.C_Proxy; 
  69.  
  70.    --------------------------------------------- 
  71.    -- Creating a notebook and inserting pages -- 
  72.    --------------------------------------------- 
  73.  
  74.    procedure Gtk_New (Widget : out Gtk_Notebook); 
  75.    --  Create a new empty notebook. 
  76.  
  77.    procedure Initialize (Widget : access Gtk_Notebook_Record'Class); 
  78.    --  Internal initialization function. 
  79.    --  See the section "Creating your own widgets" in the documentation. 
  80.  
  81.    function Get_Type return Gtk.Gtk_Type; 
  82.    --  Return the internal value associated with a Gtk_Notebook. 
  83.  
  84.    procedure Append_Page 
  85.      (Notebook  : access Gtk_Notebook_Record; 
  86.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  87.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  88.    --  Insert a new page in Notebook. 
  89.    --  The page is put at the end of the list of pages. 
  90.    --  The user will select it through a button that contains the 
  91.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  92.    --  with a pixmap in it for instance. 
  93.    --  No entry is associated with the page in the contextual menu. 
  94.  
  95.    procedure Append_Page 
  96.      (Notebook  : access Gtk_Notebook_Record; 
  97.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class); 
  98.    --  Same as above, but no label is specified. 
  99.  
  100.    procedure Append_Page_Menu 
  101.      (Notebook   : access Gtk_Notebook_Record; 
  102.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  103.       Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class; 
  104.       Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  105.    --  Insert a new page in Notebook. 
  106.    --  The page is put at the end of the list of pages. 
  107.    --  The user will select it through a button that contains the 
  108.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  109.    --  with a pixmap in it for instance. 
  110.    --  A new entry is inserted into the contextual menu. This new entry is 
  111.    --  made with Menu_Label. 
  112.  
  113.    procedure Prepend_Page 
  114.      (Notebook  : access Gtk_Notebook_Record; 
  115.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  116.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  117.    --  Insert a new page in Notebook. 
  118.    --  The page is put at the beginning of the list of pages. 
  119.    --  The user will select it through a button that contains the 
  120.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  121.    --  with a pixmap in it for instance. 
  122.    --  No entry is associated with the page in the contextual menu. 
  123.  
  124.    procedure Prepend_Page_Menu 
  125.      (Notebook   : access Gtk_Notebook_Record; 
  126.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  127.       Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class; 
  128.       Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  129.    --  Insert a new page in Notebook. 
  130.    --  The page is put at the beginning of the list of pages. 
  131.    --  The user will select it through a button that contains the 
  132.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  133.    --  with a pixmap in it for instance. 
  134.    --  A new entry is inserted into the contextual menu. This new entry is 
  135.    --  made with Menu_Label. 
  136.  
  137.    procedure Insert_Page 
  138.      (Notebook  : access Gtk_Notebook_Record; 
  139.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  140.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class; 
  141.       Position  : Gint); 
  142.    --  Insert a new page at a specific position in Notebook. 
  143.    --  The page is put at the beginning of the list of pages. 
  144.    --  The user will select it through a button that contains the 
  145.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  146.    --  with a pixmap in it for instance. 
  147.    --  No entry is associated with the page in the contextual menu. 
  148.    --  The first position in the list of pages is 0. 
  149.  
  150.    procedure Insert_Page_Menu 
  151.      (Notebook   : access Gtk_Notebook_Record; 
  152.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  153.       Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class; 
  154.       Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class; 
  155.       Position   : Gint); 
  156.    --  Insert a new page at a specific position in Notebook. 
  157.    --  The page is put at the beginning of the list of pages. 
  158.    --  The user will select it through a button that contains the 
  159.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  160.    --  with a pixmap in it for instance. 
  161.    --  A new entry is inserted into the contextual menu. This new entry is 
  162.    --  made with Menu_Label. 
  163.    --  The first position in the list of pages is 0. 
  164.  
  165.    procedure Remove_Page 
  166.      (Notebook : access Gtk_Notebook_Record; Page_Num : Gint); 
  167.    --  Remove a page from the notebook. 
  168.    --  The first position in the list of pages is 0. 
  169.  
  170.    ------------------------ 
  171.    -- Tabs drag and drop -- 
  172.    ------------------------ 
  173.  
  174.    type Gtk_Notebook_Window_Creation_Func is access 
  175.      function (Source : System.Address; --  Gtk_Notebook 
  176.                Page   : System.Address; --  Gtk_Widget 
  177.                X      : System.Address; --  Gint 
  178.                Y      : System.Address; --  Gint 
  179.                Data   : System.Address) return Gtk_Notebook; 
  180.    pragma Convention (C, Gtk_Notebook_Window_Creation_Func); 
  181.  
  182.    procedure Set_Window_Creation_Hook 
  183.      (Func     : Gtk_Notebook_Window_Creation_Func; 
  184.       Data     : System.Address; 
  185.       Destroy  : Glib.G_Destroy_Notify_Address); 
  186.    pragma Obsolescent (Set_Window_Creation_Hook); 
  187.    --  Install a global function used to create a window when a detached tab 
  188.    --  is dropped in an empty area. 
  189.  
  190.    -------------------------------------------- 
  191.    -- Modifying and getting the current page -- 
  192.    -------------------------------------------- 
  193.  
  194.    function Get_Current_Page 
  195.      (Notebook : access Gtk_Notebook_Record) return Gint; 
  196.    --  Get the number of the current page. 
  197.    --  The first page has the number 0. 
  198.  
  199.    function Get_Nth_Page 
  200.      (Widget   : access Gtk_Notebook_Record'Class; 
  201.       Page_Num : Gint) return Gtk.Widget.Gtk_Widget; 
  202.    --  Convert from a page number to the real page. 
  203.  
  204.    function Get_N_Pages 
  205.      (Notebook : access Gtk_Notebook_Record) return Gint; 
  206.    --  Return the number of pages in the notebook 
  207.  
  208.    function Page_Num 
  209.      (Widget : access Gtk_Notebook_Record'Class; 
  210.       Child  : access Gtk.Widget.Gtk_Widget_Record'Class) return Gint; 
  211.    --  Convert from a child to a page number. 
  212.    --  Note that Child is not the notebook page, but the widget you inserted 
  213.    --  with Insert_Page, Append_Page,... 
  214.  
  215.    procedure Set_Current_Page 
  216.      (Notebook : access Gtk_Notebook_Record; 
  217.       Page_Num : Gint := -1); 
  218.    --  Modify the current page. 
  219.    --  The current page is the page that is currently visible on the screen. 
  220.    --  Nothing happens if there is no such page. 
  221.    --  Note also that the page has to be visible on the screen (ie you must 
  222.    --  have called Gtk.Widget.Show on it first). 
  223.    --  Use -1 to set the current page to the last one. 
  224.    -- 
  225.    --  Note: This call won't succeeded unless you have called Show on the 
  226.    --  widget displayed in the page. 
  227.  
  228.    procedure Set_Page 
  229.      (Notebook : access Gtk_Notebook_Record; 
  230.       Page_Num : Gint := -1) 
  231.      renames Set_Current_Page; 
  232.    --  This function is deprecated. Use Set_Current_Page instead. 
  233.  
  234.    procedure Next_Page (Notebook : access Gtk_Notebook_Record); 
  235.    --  Display the next page on the screen. 
  236.  
  237.    procedure Prev_Page (Notebook : access Gtk_Notebook_Record); 
  238.    --  Display the previous page on the screen. 
  239.  
  240.    ----------------------------- 
  241.    -- Style and visual aspect -- 
  242.    ----------------------------- 
  243.  
  244.    procedure Set_Show_Border 
  245.      (Notebook    : access Gtk_Notebook_Record; 
  246.       Show_Border : Boolean := True); 
  247.    --  Indicate whether the notebook should display borders. 
  248.    --  This border gives a 3D aspect to the notebook. 
  249.  
  250.    function Get_Show_Border 
  251.      (Notebook : access Gtk_Notebook_Record) return Boolean; 
  252.    --  Return whether the notebook displays borders. 
  253.  
  254.    procedure Set_Show_Tabs 
  255.      (Notebook  : access Gtk_Notebook_Record; 
  256.       Show_Tabs : Boolean := True); 
  257.    --  Indicate whether the tabs should be displayed. 
  258.    --  If the tabs are not displayed, the only way for the user to select a 
  259.    --  new page is through the contextual menu, and thus you should make sure 
  260.    --  that the pages were created with the Insert_Page_Menu, ... subprograms. 
  261.  
  262.    function Get_Show_Tabs 
  263.      (Notebook : access Gtk_Notebook_Record) return Boolean; 
  264.    --  Return whether the tabs are displayed. 
  265.  
  266.    procedure Set_Tab_Pos 
  267.      (Notebook : access Gtk_Notebook_Record; 
  268.       Pos      : Gtk.Enums.Gtk_Position_Type); 
  269.    --  Change the position of the tabs. 
  270.    --  The tabs can be displayed on any of the four sides of the notebook. 
  271.  
  272.    function Get_Tab_Pos 
  273.      (Widget : access Gtk_Notebook_Record) return Gtk.Enums.Gtk_Position_Type; 
  274.    --  Return the current position of the tabs. 
  275.  
  276.    procedure Set_Scrollable 
  277.      (Notebook   : access Gtk_Notebook_Record; 
  278.       Scrollable : Boolean := True); 
  279.    --  Indicate whether Notebook display scrolling arrows when there are 
  280.    --  too many tabs. 
  281.    --  The default is not to display such scrolling arrows. Note also that 
  282.    --  a notebook with too many pages, even if the scrolling is activated, 
  283.    --  is sometimes hard to use for the user. 
  284.  
  285.    function Get_Scrollable 
  286.      (Notebook : access Gtk_Notebook_Record) return Boolean; 
  287.    --  Return whether Notebook is scrollable. 
  288.    --  See Set_Scrollable for more details. 
  289.  
  290.    ---------------- 
  291.    -- Popup Menu -- 
  292.    ---------------- 
  293.    --  The pages of a notebook can be selected both via tabs and a contextual 
  294.    --  menu (right mouse button). Note however that the menu is available only 
  295.    --  if the pages were inserted with Insert_Page_Menu, Append_Page_Menu or 
  296.    --  Prepend_Page_Menu. 
  297.  
  298.    procedure Popup_Enable (Notebook : access Gtk_Notebook_Record); 
  299.    --  Enable the popup menu. 
  300.    --  When the user pressed the right mouse button, a menu is selected that 
  301.    --  allows him to select a new page. 
  302.  
  303.    procedure Popup_Disable (Notebook : access Gtk_Notebook_Record); 
  304.    --  Disable the popup menu. 
  305.    --  This menu won't be display any more when the user pressed the right 
  306.    --  mouse button. 
  307.  
  308.    --------------------- 
  309.    -- Page properties -- 
  310.    --------------------- 
  311.  
  312.    function Get_Tab_Label 
  313.      (Notebook  : access Gtk_Notebook_Record; 
  314.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class) 
  315.       return Gtk.Widget.Gtk_Widget; 
  316.    --  Return the widget displayed in the tab used to select Page. 
  317.    --  This widget is in fact the one given in argument to Insert_Page,etc. 
  318.    --  when the page was created. 
  319.  
  320.    procedure Set_Tab_Label 
  321.      (Notebook  : access Gtk_Notebook_Record; 
  322.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  323.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  324.    --  Modify the widget displayed in the tab for the page that contains Child. 
  325.    --  Tab_Label is generally a Gtk_Label, although it can also be a Gtk_Box 
  326.    --  that contains a Gtk_Pixmap and a Gtk_Label if you want to show pixmaps. 
  327.    -- 
  328.    --  Note that you will need to call Show_All on Tab_Label: since it is not 
  329.    --  a Child of the notebook in the sense of Gtk_Container, the Show_All 
  330.    --  passed to the notebook will not be transmitted to the Tab_Label. 
  331.  
  332.    procedure Set_Tab_Label_Text 
  333.      (Notebook : access Gtk_Notebook_Record; 
  334.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  335.       Tab_Text : UTF8_String); 
  336.    --  Modify the text displayed in the tab for the page that contains Child. 
  337.    --  This is a less general form of Set_Tab_Label above. 
  338.  
  339.    function Get_Tab_Label_Text 
  340.      (Notebook : access Gtk_Notebook_Record; 
  341.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class) return UTF8_String; 
  342.    --  Return the text displayed in the tab for the page that contains Child. 
  343.  
  344.    procedure Set_Tab 
  345.      (Notebook  : access Gtk_Notebook_Record; 
  346.       Page_Num  : Gint; 
  347.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  348.    --  Set Notebook tab widget for a given page number. 
  349.    --  This function is mainly intended for use by Gate. 
  350.  
  351.    function Get_Menu_Label 
  352.      (Notebook : access Gtk_Notebook_Record; 
  353.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class) 
  354.       return Gtk.Widget.Gtk_Widget; 
  355.    --  Return the widget displayed in the contextual menu for the Child. 
  356.    --  This is the widget given in argument to Insert_Page_Menu, 
  357.    --  Append_Page_Menu and Prepend_Page_Menu. 
  358.  
  359.    procedure Set_Menu_Label 
  360.      (Notebook   : access Gtk_Notebook_Record; 
  361.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  362.       Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  363.    --  Modify the widget displayed in the contextual menu for the page 
  364.    --  that contains Child. 
  365.  
  366.    procedure Set_Menu_Label_Text 
  367.      (Notebook  : access Gtk_Notebook_Record; 
  368.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  369.       Menu_Text : UTF8_String); 
  370.    --  Modify the text displayed in the contextual menu for the page that 
  371.    --  contains Child. 
  372.    --  This is a less general form of Set_Menu_Label above. 
  373.  
  374.    function Get_Menu_Label_Text 
  375.      (Notebook  : access Gtk_Notebook_Record; 
  376.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class) 
  377.       return UTF8_String; 
  378.    --  Return the text displayed in the contextual menu for the page that 
  379.    --  contains Child. 
  380.  
  381.    procedure Query_Tab_Label_Packing 
  382.      (Notebook   : access Gtk_Notebook_Record; 
  383.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  384.       Expand     : out Boolean; 
  385.       Fill       : out Boolean; 
  386.       Pack_Type  : out Gtk.Enums.Gtk_Pack_Type); 
  387.    pragma Obsolescent (Query_Tab_Label_Packing); 
  388.    --  Return the packing used for the tab associated with the page 
  389.    --  that contains Child. 
  390.    --  See the Gtk.Box package for more information on the parameters. 
  391.  
  392.    procedure Set_Tab_Label_Packing 
  393.      (Notebook  : access Gtk_Notebook_Record; 
  394.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  395.       Expand    : Boolean; 
  396.       Fill      : Boolean; 
  397.       Pack_Type : Gtk.Enums.Gtk_Pack_Type); 
  398.    pragma Obsolescent (Set_Tab_Label_Packing); 
  399.    --  Modify the packing used for the tab associated with the page that 
  400.    --  contains Child. 
  401.  
  402.    procedure Reorder_Child 
  403.      (Notebook : access Gtk_Notebook_Record; 
  404.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  405.       Position : Gint); 
  406.    --  Change the position of the page that contains Child. 
  407.  
  408.    function Get_Tab_Reorderable 
  409.      (Notebook : access Gtk_Notebook_Record; 
  410.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  411.       Position : Gint) 
  412.       return Boolean; 
  413.    --  Get whether the tab can be reordered via drag and drop or not. 
  414.  
  415.    procedure Set_Tab_Reorderable 
  416.      (Notebook    : access Gtk_Notebook_Record; 
  417.       Child       : access Gtk.Widget.Gtk_Widget_Record'Class; 
  418.       Reorderable : Boolean := True); 
  419.    --  Set whether the notebook tab can be reordered. 
  420.  
  421.    function Get_Tab_Detachable 
  422.      (Notebook : access Gtk_Notebook_Record; 
  423.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  424.       Position : Gint) 
  425.       return Boolean; 
  426.    --  Return whether the tab contents can be detached from Notebook. 
  427.  
  428.    procedure Set_Tab_Detachable 
  429.      (Notebook   : access Gtk_Notebook_Record; 
  430.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  431.       Detachable : Boolean := True); 
  432.    --  Set whether the tab can be detached from Notebook to another 
  433.    --  notebook or widget. 
  434.    -- 
  435.    --  Note that 2 notebooks must share a common group identificator 
  436.    --  (see Set_Group_Id) to allow automatic tabs interchange between them. 
  437.    -- 
  438.    --  If you want a widget to interact with a notebook through DnD 
  439.    --  (i.e.: accept dragged tabs from it) it must be set as a drop 
  440.    --  destination and accept the target "GTK_NOTEBOOK_TAB". The notebook 
  441.    --  will fill the selection with a Gtk_Widget pointing to the child 
  442.    --  widget that corresponds to the dropped tab. 
  443.    -- 
  444.    --  If you want a notebook to accept drags from other widgets, 
  445.    --  you will have to set your own DnD code to do it. 
  446.  
  447.    function Get_Group (Notebook : access Gtk_Notebook_Record) 
  448.       return Gtk_Notebook_Group; 
  449.    pragma Obsolescent (Get_Group); 
  450.    procedure Set_Group 
  451.      (Notebook : access Gtk_Notebook_Record; 
  452.       Group    : Gtk_Notebook_Group); 
  453.    pragma Obsolescent (Set_Group); 
  454.    --  Gets/Sets a group identificator pointer for Notebook, notebooks sharing 
  455.    --  the same group identificator pointer will be able to exchange tabs 
  456.    --  via drag and drop. A notebook with a null group identificator will 
  457.    --  not be able to exchange tabs with any other notebook. 
  458.  
  459.    -------------------- 
  460.    -- GValue support -- 
  461.    -------------------- 
  462.  
  463.    function Get_Notebook_Page 
  464.      (Value : Glib.Values.GValue) return Gtk_Notebook_Page; 
  465.    --  Convert a Value into a notebook page. 
  466.  
  467.    ----------------- 
  468.    -- Obsolescent -- 
  469.    ----------------- 
  470.    --  All subprograms below are now obsolescent in gtk+. They might be removed 
  471.    --  from future versions of gtk+ (and therefore GtkAda). 
  472.    --  To find out whether your code uses any of these, we recommend compiling 
  473.    --  with the -gnatwj switch 
  474.    --  <doc_ignore> 
  475.  
  476.    function Convert is new Unchecked_Conversion 
  477.      (Gtk_Notebook_Page, System.Address); 
  478.    function Convert is new Unchecked_Conversion 
  479.      (System.Address, Gtk_Notebook_Page); 
  480.    package Page_List is new Glib.Glist.Generic_List (Gtk_Notebook_Page); 
  481.  
  482.    function Get_Children 
  483.      (Widget : access Gtk_Notebook_Record) return Page_List.Glist; 
  484.    pragma Obsolescent (Get_Children); 
  485.    --  Return the list of all pages in the notebook. 
  486.  
  487.    procedure Set_Homogeneous_Tabs 
  488.      (Notebook    : access Gtk_Notebook_Record; 
  489.       Homogeneous : Boolean := True); 
  490.    pragma Obsolescent (Set_Homogeneous_Tabs); 
  491.    --  Indicate whether all the tabs should have the same size (width or 
  492.    --  height, depending on which side they are displayed on). 
  493.  
  494.    procedure Set_Tab_Border 
  495.      (Notebook     : access Gtk_Notebook_Record; 
  496.       Border_Width : Gint); 
  497.    pragma Obsolescent (Set_Tab_Border); 
  498.    --  Change the width of the tabs' borders. 
  499.    --  This modifies both the horizontal border and the vertical border. 
  500.  
  501.    procedure Set_Tab_Hborder 
  502.      (Notebook     : access Gtk_Notebook_Record; 
  503.       Border_Width : Gint); 
  504.    pragma Obsolescent (Set_Tab_Hborder); 
  505.    --  Modify the width of the horizontal borders of the tabs. 
  506.  
  507.    procedure Set_Tab_Vborder 
  508.      (Notebook     : access Gtk_Notebook_Record; 
  509.       Border_Width : Gint); 
  510.    pragma Obsolescent (Set_Tab_Vborder); 
  511.    --  Modify the height of the vertical borders of the tabs. 
  512.  
  513.    procedure Set_Group_Id 
  514.      (Notebook : access Gtk_Notebook_Record; Group_Id : Gint); 
  515.    pragma Obsolescent (Set_Group_Id); 
  516.    --  Set a group identificator for Notebook. Notebooks sharing 
  517.    --  the same group identificator will be able to exchange tabs 
  518.    --  via drag and drop. A notebook with group identificator -1 will 
  519.    --  not be able to exchange tabs with any other notebook. 
  520.  
  521.    function Get_Group_Id (Notebook : access Gtk_Notebook_Record) return Gint; 
  522.    pragma Obsolescent (Get_Group_Id); 
  523.    --  Gets the current group identificator for Notebook or -1 if not set. 
  524.  
  525.    --  </doc_ignore> 
  526.  
  527.    ---------------- 
  528.    -- Properties -- 
  529.    ---------------- 
  530.    --  The following properties are defined for this widget. See 
  531.    --  Glib.Properties for more information on properties. 
  532.  
  533.    --  <properties> 
  534.    --  Name: Page_Property 
  535.    --  Type: Gint 
  536.    --  See:  Set_Current_Page / Get_Current_Page 
  537.    -- 
  538.    --  Name: Tab_Pos_Property 
  539.    --  Type: Gtk_Position_Type 
  540.    --  See:  Set_Tab_Pos / Get_Tab_Pos 
  541.    -- 
  542.    --  Name: Tab_Border_Property 
  543.    --  Type: Guint 
  544.    --  Descr: Width of the border around the tab labels 
  545.    -- 
  546.    --  Name: Tab_HBorder_Property 
  547.    --  Type: Guint 
  548.    --  Descr: Width of the horizontal border around the tab labels 
  549.    -- 
  550.    --  Name: Tab_VBorder_Property 
  551.    --  Type: Guint 
  552.    --  Descr: Width of the vertical border around the tab labels 
  553.    -- 
  554.    --  Name: Show_Tabs_Property 
  555.    --  Type: Boolean 
  556.    --  See:  Set_Show_Tabs / Get_Show_Tabs 
  557.    -- 
  558.    --  Name: Show_Border_Property 
  559.    --  Type: Boolean 
  560.    --  See:  Set_Show_Border / Get_Show_Border 
  561.    -- 
  562.    --  Name: Scrollable_Property 
  563.    --  Type: Boolean 
  564.    --  See:  Set_Scrollable / Get_Scrollable 
  565.    -- 
  566.    --  Name: Enable_Popup_Property 
  567.    --  Type: Boolean 
  568.    --  See:  Popup_Enable / Popup_Disable 
  569.    -- 
  570.    --  Name: Homogeneous_Property 
  571.    --  Type: Boolean 
  572.    --  See:  Set_Homogeneous_Tabs / - 
  573.    -- 
  574.    --  Name:  Group_Property 
  575.    --  Type:  Gtk_Notebook_Group 
  576.    --  Descr: Group for tabs drag and drop 
  577.    -- 
  578.    --  Name:  Group_Id_Property 
  579.    --  Type:  Int 
  580.    --  See: Set_Group_Id / Get_Group_Id 
  581.    --  </properties> 
  582.  
  583.    Page_Property         : constant Glib.Properties.Property_Int; 
  584.    Tab_Pos_Property      : constant Gtk.Enums.Property_Gtk_Position_Type; 
  585.    Tab_Border_Property   : constant Glib.Properties.Property_Uint; 
  586.    Tab_Hborder_Property  : constant Glib.Properties.Property_Uint; 
  587.    Tab_Vborder_Property  : constant Glib.Properties.Property_Uint; 
  588.    Show_Tabs_Property    : constant Glib.Properties.Property_Boolean; 
  589.    Show_Border_Property  : constant Glib.Properties.Property_Boolean; 
  590.    Scrollable_Property   : constant Glib.Properties.Property_Boolean; 
  591.    Enable_Popup_Property : constant Glib.Properties.Property_Boolean; 
  592.    Homogeneous_Property  : constant Glib.Properties.Property_Boolean; 
  593.    Group_Property        : constant Glib.Properties.Property_C_Proxy; 
  594.    Group_Id_Property     : constant Glib.Properties.Property_Int; 
  595.  
  596.    ---------------------- 
  597.    -- Child Properties -- 
  598.    ---------------------- 
  599.    --  The following properties can be set on children of this widget. See 
  600.    --  in particular Gtk.Containers.Child_Set_Property. 
  601.  
  602.    --  <child_properties> 
  603.    --  Name:  Menu_Label_Property 
  604.    --  Type:  String 
  605.    --  Descr: The string displayed in the child's menu entry 
  606.    -- 
  607.    --  Name:  Position_Property 
  608.    --  Type:  Int 
  609.    --  Descr: The index of the child in the parent 
  610.    -- 
  611.    --  Name:  Tab_Expand_Property 
  612.    --  Type:  Boolean 
  613.    --  Descr: Whether to expand the child's tab or not 
  614.    -- 
  615.    --  Name:  Tab_Fill_Property 
  616.    --  Type:  Boolean 
  617.    --  Descr: Whether the child's tab should fill the allocated area or not 
  618.    -- 
  619.    --  Name:  Tab_Label_Property 
  620.    --  Type:  String 
  621.    --  Descr: The string displayed on the child's tab label 
  622.    -- 
  623.    --  Name:  Tab_Pack_Property 
  624.    --  Type:  Enum 
  625.    --  Descr: A Gtk_Pack_Type indicating whether the child is packed with 
  626.    --  reference to the start or end of the parent 
  627.    -- 
  628.    --  Name:  Detachable_Property 
  629.    --  Type:  Boolean 
  630.    --  See:   Set_Tab_Detachable / Get_Tab_Detachable 
  631.    -- 
  632.    --  Name:  Reorderable_Property 
  633.    --  Type:  Boolean 
  634.    --  See:   Set_Tab_Reorderable / Get_Tab_Reorderable 
  635.    --  </child_properties> 
  636.  
  637.    Menu_Label_Property : constant Glib.Properties.Property_String; 
  638.    Position_Property   : constant Glib.Properties.Property_Int; 
  639.    Tab_Expand_Property : constant Glib.Properties.Property_Boolean; 
  640.    Tab_Fill_Property   : constant Glib.Properties.Property_Boolean; 
  641.    Tab_Label_Property  : constant Glib.Properties.Property_String; 
  642.    Tab_Pack_Property   : constant Gtk.Enums.Property_Pack_Type; 
  643.    Detachable_Property : constant Glib.Properties.Property_Boolean; 
  644.    Reorderable_Property : constant Glib.Properties.Property_Boolean; 
  645.  
  646.    ---------------------- 
  647.    -- Style Properties -- 
  648.    ---------------------- 
  649.    --  The following properties can be changed through the gtk theme and 
  650.    --  configuration files, and retrieved through Gtk.Widget.Style_Get_Property 
  651.  
  652.    --  <style_properties> 
  653.    --  Name:  Arrow_Spacing_Property 
  654.    --  Type:  Int 
  655.    --  Descr: Scroll arrow spacing 
  656.    -- 
  657.    --  Name:  Has_Backward_Stepper_Property 
  658.    --  Type:  Boolean 
  659.    --  Descr: Display the standard backward arrow button 
  660.    -- 
  661.    --  Name:  Has_Forward_Stepper_Property 
  662.    --  Type:  Boolean 
  663.    --  Descr: Display the standard forward arrow button 
  664.    -- 
  665.    --  Name:  Has_Secondary_Backward_Stepper_Property 
  666.    --  Type:  Boolean 
  667.    --  Descr: Display a second backward arrow button on the opposite end of the 
  668.    --         tab area 
  669.    -- 
  670.    --  Name:  Has_Secondary_Forward_Stepper_Property 
  671.    --  Type:  Boolean 
  672.    --  Descr: Display a second forward arrow button on the opposite end of the 
  673.    --         tab area 
  674.    -- 
  675.    --  Name:  Tab_Curvature_Property 
  676.    --  Type:  Int 
  677.    --  Descr: Size of tab curvature 
  678.    -- 
  679.    --  Name:  Tab_Overlap_Property 
  680.    --  Type:  Int 
  681.    --  Descr: Size of tab overlap area 
  682.    --  </style_properties> 
  683.  
  684.    Arrow_Spacing_Property        : constant Glib.Properties.Property_Int; 
  685.    Has_Backward_Stepper_Property : constant Glib.Properties.Property_Boolean; 
  686.    Has_Forward_Stepper_Property  : constant Glib.Properties.Property_Boolean; 
  687.    Has_Secondary_Backward_Stepper_Property : constant 
  688.      Glib.Properties.Property_Boolean; 
  689.    Has_Secondary_Forward_Stepper_Property  : constant 
  690.      Glib.Properties.Property_Boolean; 
  691.    Tab_Curvature_Property        : constant Glib.Properties.Property_Int; 
  692.    Tab_Overlap_Property          : constant Glib.Properties.Property_Int; 
  693.  
  694.    ------------- 
  695.    -- Signals -- 
  696.    ------------- 
  697.  
  698.    --  <signals> 
  699.    --  The following new signals are defined for this widget: 
  700.    -- 
  701.    --  - "switch_page" 
  702.    --    procedure Handler 
  703.    --      (Notebook : access Gtk_Notebook_Record'Class; 
  704.    --       Page     : Gtk_Notebook_Page; 
  705.    --       Page_Num : Guint); 
  706.    --   Notify when the current page is modified in the notebook. 
  707.    --   This is called every time the user selected a new page, or the 
  708.    --   program selected a new page with Next_Page, Prev_Page, ... 
  709.    -- 
  710.    --  - "select_page" 
  711.    --    function Handler 
  712.    --      (Notebook   : access Gtk_Notebook_Record'Class; 
  713.    --       Move_Focus : Boolean) return Boolean; 
  714.    --    You should emit this signal to request that the notebook selects the 
  715.    --    page corresponding to the focus tab. If Move_Focus is true, the page 
  716.    --    acquires the keyboard focus. 
  717.    --    Seldom used. 
  718.    -- 
  719.    --  - "focus_tab" 
  720.    --    function Handler 
  721.    --       (Notebook : access Gtk_Notebook_Record'Class; 
  722.    --        Tab      : Gtk_Notebook_Tab) return Boolean; 
  723.    --    Gives the focus to one of the tabs in the notebook. This signal is 
  724.    --    mostly used as a keybinding for Home, End,... so that the proper 
  725.    --    behavior can be implemented 
  726.    -- 
  727.    --  - "move_focus_out" 
  728.    --    procedure Handler 
  729.    --      (Notebook  : access Gtk_Notebook_Record'Class; 
  730.    --       Direction : Gtk_Direction_Type); 
  731.    --    You should emit this signal to request that the focus be transfered 
  732.    --    from the current page to the parent widget. 
  733.    --    Seldom used. 
  734.    -- 
  735.    --  - "change_current_page" 
  736.    --    procedure Handler 
  737.    --      (Notebook : access Gtk_Notebook_Record'Class; 
  738.    --       Offset   : Gint); 
  739.    --    You should emit this signal to request that the notebook selects 
  740.    --    another page as the current page. The offset is relative to the 
  741.    --    currently selected page. 
  742.    -- 
  743.    --  </signals> 
  744.  
  745.    Signal_Switch_Page         : constant Glib.Signal_Name := "switch_page"; 
  746.    Signal_Select_Page         : constant Glib.Signal_Name := "select_page"; 
  747.    Signal_Focus_Tab           : constant Glib.Signal_Name := "focus_tab"; 
  748.    Signal_Move_Focus_Out      : constant Glib.Signal_Name := "move_focus_out"; 
  749.    Signal_Change_Current_Page : constant Glib.Signal_Name := 
  750.                                   "change_current_page"; 
  751.  
  752. private 
  753.    type Gtk_Notebook_Record is new Gtk.Container.Gtk_Container_Record 
  754.      with null record; 
  755.    pragma Import (C, Get_Type, "gtk_notebook_get_type"); 
  756.  
  757.    Page_Property : constant Glib.Properties.Property_Int := 
  758.      Glib.Properties.Build ("page"); 
  759.    Tab_Pos_Property : constant Gtk.Enums.Property_Gtk_Position_Type := 
  760.      Gtk.Enums.Build ("tab-pos"); 
  761.    Tab_Border_Property : constant Glib.Properties.Property_Uint := 
  762.      Glib.Properties.Build ("tab-border"); 
  763.    Tab_Hborder_Property : constant Glib.Properties.Property_Uint := 
  764.      Glib.Properties.Build ("tab-hborder"); 
  765.    Tab_Vborder_Property : constant Glib.Properties.Property_Uint := 
  766.      Glib.Properties.Build ("tab-vborder"); 
  767.    Show_Tabs_Property   : constant Glib.Properties.Property_Boolean := 
  768.      Glib.Properties.Build ("show-tabs"); 
  769.    Show_Border_Property   : constant Glib.Properties.Property_Boolean := 
  770.      Glib.Properties.Build ("show-border"); 
  771.    Scrollable_Property   : constant Glib.Properties.Property_Boolean := 
  772.      Glib.Properties.Build ("scrollable"); 
  773.    Enable_Popup_Property   : constant Glib.Properties.Property_Boolean := 
  774.      Glib.Properties.Build ("enable-popup"); 
  775.    Homogeneous_Property  : constant Glib.Properties.Property_Boolean := 
  776.      Glib.Properties.Build ("homogeneous"); 
  777.    Group_Property : constant Glib.Properties.Property_C_Proxy := 
  778.      Glib.Properties.Build ("group"); 
  779.    Group_Id_Property : constant Glib.Properties.Property_Int := 
  780.      Glib.Properties.Build ("group-id"); 
  781.  
  782.    Menu_Label_Property : constant Glib.Properties.Property_String := 
  783.      Glib.Properties.Build ("menu-label"); 
  784.    Position_Property : constant Glib.Properties.Property_Int := 
  785.      Glib.Properties.Build ("position"); 
  786.    Tab_Expand_Property : constant Glib.Properties.Property_Boolean := 
  787.      Glib.Properties.Build ("tab-expand"); 
  788.    Tab_Fill_Property : constant Glib.Properties.Property_Boolean := 
  789.      Glib.Properties.Build ("tab-fill"); 
  790.    Tab_Label_Property : constant Glib.Properties.Property_String := 
  791.      Glib.Properties.Build ("tab-label"); 
  792.    Tab_Pack_Property : constant Gtk.Enums.Property_Pack_Type := 
  793.      Gtk.Enums.Build ("tab-pack"); 
  794.    Detachable_Property : constant Glib.Properties.Property_Boolean := 
  795.      Glib.Properties.Build ("detachable"); 
  796.    Reorderable_Property : constant Glib.Properties.Property_Boolean := 
  797.      Glib.Properties.Build ("reorderable"); 
  798.  
  799.    Arrow_Spacing_Property : constant Glib.Properties.Property_Int := 
  800.      Glib.Properties.Build ("arrow-spacing"); 
  801.    Has_Backward_Stepper_Property : constant Glib.Properties.Property_Boolean := 
  802.      Glib.Properties.Build ("has-backward-stepper"); 
  803.    Has_Forward_Stepper_Property : constant Glib.Properties.Property_Boolean := 
  804.      Glib.Properties.Build ("has-forward-stepper"); 
  805.    Has_Secondary_Backward_Stepper_Property : constant 
  806.      Glib.Properties.Property_Boolean := 
  807.      Glib.Properties.Build ("has-secondary-backward-stepper"); 
  808.    Has_Secondary_Forward_Stepper_Property : constant 
  809.      Glib.Properties.Property_Boolean := 
  810.      Glib.Properties.Build ("has-secondary-forward-stepper"); 
  811.    Tab_Curvature_Property : constant Glib.Properties.Property_Int := 
  812.      Glib.Properties.Build ("tab-curvature"); 
  813.    Tab_Overlap_Property : constant Glib.Properties.Property_Int := 
  814.      Glib.Properties.Build ("tab-overlap"); 
  815.  
  816. end Gtk.Notebook;