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-2010, 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.    --  Install a global function used to create a window when a detached tab 
  187.    --  is dropped in an empty area. 
  188.  
  189.    -------------------------------------------- 
  190.    -- Modifying and getting the current page -- 
  191.    -------------------------------------------- 
  192.  
  193.    function Get_Current_Page 
  194.      (Notebook : access Gtk_Notebook_Record) return Gint; 
  195.    --  Get the number of the current page. 
  196.    --  The first page has the number 0. 
  197.  
  198.    function Get_Nth_Page 
  199.      (Widget   : access Gtk_Notebook_Record'Class; 
  200.       Page_Num : Gint) return Gtk.Widget.Gtk_Widget; 
  201.    --  Convert from a page number to the real page. 
  202.  
  203.    function Get_N_Pages 
  204.      (Notebook : access Gtk_Notebook_Record) return Gint; 
  205.    --  Return the number of pages in the notebook 
  206.  
  207.    function Page_Num 
  208.      (Widget : access Gtk_Notebook_Record'Class; 
  209.       Child  : access Gtk.Widget.Gtk_Widget_Record'Class) return Gint; 
  210.    --  Convert from a child to a page number. 
  211.    --  Note that Child is not the notebook page, but the widget you inserted 
  212.    --  with Insert_Page, Append_Page,... 
  213.  
  214.    procedure Set_Current_Page 
  215.      (Notebook : access Gtk_Notebook_Record; 
  216.       Page_Num : Gint := -1); 
  217.    --  Modify the current page. 
  218.    --  The current page is the page that is currently visible on the screen. 
  219.    --  Nothing happens if there is no such page. 
  220.    --  Note also that the page has to be visible on the screen (ie you must 
  221.    --  have called Gtk.Widget.Show on it first). 
  222.    --  Use -1 to set the current page to the last one. 
  223.    -- 
  224.    --  Note: This call won't succeeded unless you have called Show on the 
  225.    --  widget displayed in the page. 
  226.  
  227.    procedure Set_Page 
  228.      (Notebook : access Gtk_Notebook_Record; 
  229.       Page_Num : Gint := -1) 
  230.      renames Set_Current_Page; 
  231.    --  This function is deprecated. Use Set_Current_Page instead. 
  232.  
  233.    procedure Next_Page (Notebook : access Gtk_Notebook_Record); 
  234.    --  Display the next page on the screen. 
  235.  
  236.    procedure Prev_Page (Notebook : access Gtk_Notebook_Record); 
  237.    --  Display the previous page on the screen. 
  238.  
  239.    ----------------------------- 
  240.    -- Style and visual aspect -- 
  241.    ----------------------------- 
  242.  
  243.    procedure Set_Show_Border 
  244.      (Notebook    : access Gtk_Notebook_Record; 
  245.       Show_Border : Boolean := True); 
  246.    --  Indicate whether the notebook should display borders. 
  247.    --  This border gives a 3D aspect to the notebook. 
  248.  
  249.    function Get_Show_Border 
  250.      (Notebook : access Gtk_Notebook_Record) return Boolean; 
  251.    --  Return whether the notebook displays borders. 
  252.  
  253.    procedure Set_Show_Tabs 
  254.      (Notebook  : access Gtk_Notebook_Record; 
  255.       Show_Tabs : Boolean := True); 
  256.    --  Indicate whether the tabs should be displayed. 
  257.    --  If the tabs are not displayed, the only way for the user to select a 
  258.    --  new page is through the contextual menu, and thus you should make sure 
  259.    --  that the pages were created with the Insert_Page_Menu, ... subprograms. 
  260.  
  261.    function Get_Show_Tabs 
  262.      (Notebook : access Gtk_Notebook_Record) return Boolean; 
  263.    --  Return whether the tabs are displayed. 
  264.  
  265.    procedure Set_Tab_Pos 
  266.      (Notebook : access Gtk_Notebook_Record; 
  267.       Pos      : Gtk.Enums.Gtk_Position_Type); 
  268.    --  Change the position of the tabs. 
  269.    --  The tabs can be displayed on any of the four sides of the notebook. 
  270.  
  271.    function Get_Tab_Pos 
  272.      (Widget : access Gtk_Notebook_Record) return Gtk.Enums.Gtk_Position_Type; 
  273.    --  Return the current position of the tabs. 
  274.  
  275.    procedure Set_Scrollable 
  276.      (Notebook   : access Gtk_Notebook_Record; 
  277.       Scrollable : Boolean := True); 
  278.    --  Indicate whether Notebook display scrolling arrows when there are 
  279.    --  too many tabs. 
  280.    --  The default is not to display such scrolling arrows. Note also that 
  281.    --  a notebook with too many pages, even if the scrolling is activated, 
  282.    --  is sometimes hard to use for the user. 
  283.  
  284.    function Get_Scrollable 
  285.      (Notebook : access Gtk_Notebook_Record) return Boolean; 
  286.    --  Return whether Notebook is scrollable. 
  287.    --  See Set_Scrollable for more details. 
  288.  
  289.    ---------------- 
  290.    -- Popup Menu -- 
  291.    ---------------- 
  292.    --  The pages of a notebook can be selected both via tabs and a contextual 
  293.    --  menu (right mouse button). Note however that the menu is available only 
  294.    --  if the pages were inserted with Insert_Page_Menu, Append_Page_Menu or 
  295.    --  Prepend_Page_Menu. 
  296.  
  297.    procedure Popup_Enable (Notebook : access Gtk_Notebook_Record); 
  298.    --  Enable the popup menu. 
  299.    --  When the user pressed the right mouse button, a menu is selected that 
  300.    --  allows him to select a new page. 
  301.  
  302.    procedure Popup_Disable (Notebook : access Gtk_Notebook_Record); 
  303.    --  Disable the popup menu. 
  304.    --  This menu won't be display any more when the user pressed the right 
  305.    --  mouse button. 
  306.  
  307.    --------------------- 
  308.    -- Page properties -- 
  309.    --------------------- 
  310.  
  311.    function Get_Tab_Label 
  312.      (Notebook  : access Gtk_Notebook_Record; 
  313.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class) 
  314.       return Gtk.Widget.Gtk_Widget; 
  315.    --  Return the widget displayed in the tab used to select Page. 
  316.    --  This widget is in fact the one given in argument to Insert_Page,etc. 
  317.    --  when the page was created. 
  318.  
  319.    procedure Set_Tab_Label 
  320.      (Notebook  : access Gtk_Notebook_Record; 
  321.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  322.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  323.    --  Modify the widget displayed in the tab for the page that contains Child. 
  324.    --  Tab_Label is generally a Gtk_Label, although it can also be a Gtk_Box 
  325.    --  that contains a Gtk_Pixmap and a Gtk_Label if you want to show pixmaps. 
  326.    -- 
  327.    --  Note that you will need to call Show_All on Tab_Label: since it is not 
  328.    --  a Child of the notebook in the sense of Gtk_Container, the Show_All 
  329.    --  passed to the notebook will not be transmitted to the Tab_Label. 
  330.  
  331.    procedure Set_Tab_Label_Text 
  332.      (Notebook : access Gtk_Notebook_Record; 
  333.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  334.       Tab_Text : UTF8_String); 
  335.    --  Modify the text displayed in the tab for the page that contains Child. 
  336.    --  This is a less general form of Set_Tab_Label above. 
  337.  
  338.    function Get_Tab_Label_Text 
  339.      (Notebook : access Gtk_Notebook_Record; 
  340.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class) return UTF8_String; 
  341.    --  Return the text displayed in the tab for the page that contains Child. 
  342.  
  343.    procedure Set_Tab 
  344.      (Notebook  : access Gtk_Notebook_Record; 
  345.       Page_Num  : Gint; 
  346.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  347.    --  Set Notebook tab widget for a given page number. 
  348.    --  This function is mainly intended for use by Gate. 
  349.  
  350.    function Get_Menu_Label 
  351.      (Notebook : access Gtk_Notebook_Record; 
  352.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class) 
  353.       return Gtk.Widget.Gtk_Widget; 
  354.    --  Return the widget displayed in the contextual menu for the Child. 
  355.    --  This is the widget given in argument to Insert_Page_Menu, 
  356.    --  Append_Page_Menu and Prepend_Page_Menu. 
  357.  
  358.    procedure Set_Menu_Label 
  359.      (Notebook   : access Gtk_Notebook_Record; 
  360.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  361.       Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  362.    --  Modify the widget displayed in the contextual menu for the page 
  363.    --  that contains Child. 
  364.  
  365.    procedure Set_Menu_Label_Text 
  366.      (Notebook  : access Gtk_Notebook_Record; 
  367.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  368.       Menu_Text : UTF8_String); 
  369.    --  Modify the text displayed in the contextual menu for the page that 
  370.    --  contains Child. 
  371.    --  This is a less general form of Set_Menu_Label above. 
  372.  
  373.    function Get_Menu_Label_Text 
  374.      (Notebook  : access Gtk_Notebook_Record; 
  375.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class) 
  376.       return UTF8_String; 
  377.    --  Return the text displayed in the contextual menu for the page that 
  378.    --  contains Child. 
  379.  
  380.    procedure Query_Tab_Label_Packing 
  381.      (Notebook   : access Gtk_Notebook_Record; 
  382.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  383.       Expand     : out Boolean; 
  384.       Fill       : out Boolean; 
  385.       Pack_Type  : out Gtk.Enums.Gtk_Pack_Type); 
  386.    --  Return the packing used for the tab associated with the page 
  387.    --  that contains Child. 
  388.    --  See the Gtk.Box package for more information on the parameters. 
  389.  
  390.    procedure Set_Tab_Label_Packing 
  391.      (Notebook  : access Gtk_Notebook_Record; 
  392.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  393.       Expand    : Boolean; 
  394.       Fill      : Boolean; 
  395.       Pack_Type : Gtk.Enums.Gtk_Pack_Type); 
  396.    --  Modify the packing used for the tab associated with the page that 
  397.    --  contains Child. 
  398.  
  399.    procedure Reorder_Child 
  400.      (Notebook : access Gtk_Notebook_Record; 
  401.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  402.       Position : Gint); 
  403.    --  Change the position of the page that contains Child. 
  404.  
  405.    function Get_Tab_Reorderable 
  406.      (Notebook : access Gtk_Notebook_Record; 
  407.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  408.       Position : Gint) 
  409.       return Boolean; 
  410.    --  Get whether the tab can be reordered via drag and drop or not. 
  411.  
  412.    procedure Set_Tab_Reorderable 
  413.      (Notebook    : access Gtk_Notebook_Record; 
  414.       Child       : access Gtk.Widget.Gtk_Widget_Record'Class; 
  415.       Reorderable : Boolean := True); 
  416.    --  Set whether the notebook tab can be reordered. 
  417.  
  418.    function Get_Tab_Detachable 
  419.      (Notebook : access Gtk_Notebook_Record; 
  420.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  421.       Position : Gint) 
  422.       return Boolean; 
  423.    --  Return whether the tab contents can be detached from Notebook. 
  424.  
  425.    procedure Set_Tab_Detachable 
  426.      (Notebook   : access Gtk_Notebook_Record; 
  427.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  428.       Detachable : Boolean := True); 
  429.    --  Set whether the tab can be detached from Notebook to another 
  430.    --  notebook or widget. 
  431.    -- 
  432.    --  Note that 2 notebooks must share a common group identificator 
  433.    --  (see Set_Group_Id) to allow automatic tabs interchange between them. 
  434.    -- 
  435.    --  If you want a widget to interact with a notebook through DnD 
  436.    --  (i.e.: accept dragged tabs from it) it must be set as a drop 
  437.    --  destination and accept the target "GTK_NOTEBOOK_TAB". The notebook 
  438.    --  will fill the selection with a Gtk_Widget pointing to the child 
  439.    --  widget that corresponds to the dropped tab. 
  440.    -- 
  441.    --  If you want a notebook to accept drags from other widgets, 
  442.    --  you will have to set your own DnD code to do it. 
  443.  
  444.    function Get_Group (Notebook : access Gtk_Notebook_Record) 
  445.       return Gtk_Notebook_Group; 
  446.    procedure Set_Group 
  447.      (Notebook : access Gtk_Notebook_Record; 
  448.       Group    : Gtk_Notebook_Group); 
  449.    --  Gets/Sets a group identificator pointer for Notebook, notebooks sharing 
  450.    --  the same group identificator pointer will be able to exchange tabs 
  451.    --  via drag and drop. A notebook with a null group identificator will 
  452.    --  not be able to exchange tabs with any other notebook. 
  453.  
  454.    -------------------- 
  455.    -- GValue support -- 
  456.    -------------------- 
  457.  
  458.    function Get_Notebook_Page 
  459.      (Value : Glib.Values.GValue) return Gtk_Notebook_Page; 
  460.    --  Convert a Value into a notebook page. 
  461.  
  462.    ----------------- 
  463.    -- Obsolescent -- 
  464.    ----------------- 
  465.    --  All subprograms below are now obsolescent in gtk+. They might be removed 
  466.    --  from future versions of gtk+ (and therefore GtkAda). 
  467.    --  To find out whether your code uses any of these, we recommend compiling 
  468.    --  with the -gnatwj switch 
  469.    --  <doc_ignore> 
  470.  
  471.    function Convert is new Unchecked_Conversion 
  472.      (Gtk_Notebook_Page, System.Address); 
  473.    function Convert is new Unchecked_Conversion 
  474.      (System.Address, Gtk_Notebook_Page); 
  475.    package Page_List is new Glib.Glist.Generic_List (Gtk_Notebook_Page); 
  476.  
  477.    function Get_Children 
  478.      (Widget : access Gtk_Notebook_Record) return Page_List.Glist; 
  479.    pragma Obsolescent; 
  480.    --  Return the list of all pages in the notebook. 
  481.  
  482.    procedure Set_Homogeneous_Tabs 
  483.      (Notebook    : access Gtk_Notebook_Record; 
  484.       Homogeneous : Boolean := True); 
  485.    pragma Obsolescent;  --  Set_Homogeneous_Tabs 
  486.    --  Indicate whether all the tabs should have the same size (width or 
  487.    --  height, depending on which side they are displayed on). 
  488.  
  489.    procedure Set_Tab_Border 
  490.      (Notebook     : access Gtk_Notebook_Record; 
  491.       Border_Width : Gint); 
  492.    pragma Obsolescent;  --  Set_Tab_Border 
  493.    --  Change the width of the tabs' borders. 
  494.    --  This modifies both the horizontal border and the vertical border. 
  495.  
  496.    procedure Set_Tab_Hborder 
  497.      (Notebook     : access Gtk_Notebook_Record; 
  498.       Border_Width : Gint); 
  499.    pragma Obsolescent;  --  Set_Tab_Hborder 
  500.    --  Modify the width of the horizontal borders of the tabs. 
  501.  
  502.    procedure Set_Tab_Vborder 
  503.      (Notebook     : access Gtk_Notebook_Record; 
  504.       Border_Width : Gint); 
  505.    pragma Obsolescent;  --  Set_Tab_Vborder 
  506.    --  Modify the height of the vertical borders of the tabs. 
  507.  
  508.    procedure Set_Group_Id 
  509.      (Notebook : access Gtk_Notebook_Record; Group_Id : Gint); 
  510.    pragma Obsolescent; --  Set_Group_Id 
  511.    --  Set a group identificator for Notebook. Notebooks sharing 
  512.    --  the same group identificator will be able to exchange tabs 
  513.    --  via drag and drop. A notebook with group identificator -1 will 
  514.    --  not be able to exchange tabs with any other notebook. 
  515.  
  516.    function Get_Group_Id (Notebook : access Gtk_Notebook_Record) return Gint; 
  517.    pragma Obsolescent; --  Get_Group_Id 
  518.    --  Gets the current group identificator for Notebook or -1 if not set. 
  519.  
  520.    --  </doc_ignore> 
  521.  
  522.    ---------------- 
  523.    -- Properties -- 
  524.    ---------------- 
  525.    --  The following properties are defined for this widget. See 
  526.    --  Glib.Properties for more information on properties. 
  527.  
  528.    --  <properties> 
  529.    --  Name: Page_Property 
  530.    --  Type: Gint 
  531.    --  See:  Set_Current_Page / Get_Current_Page 
  532.    -- 
  533.    --  Name: Tab_Pos_Property 
  534.    --  Type: Gtk_Position_Type 
  535.    --  See:  Set_Tab_Pos / Get_Tab_Pos 
  536.    -- 
  537.    --  Name: Tab_Border_Property 
  538.    --  Type: Guint 
  539.    --  Descr: Width of the border around the tab labels 
  540.    -- 
  541.    --  Name: Tab_HBorder_Property 
  542.    --  Type: Guint 
  543.    --  Descr: Width of the horizontal border around the tab labels 
  544.    -- 
  545.    --  Name: Tab_VBorder_Property 
  546.    --  Type: Guint 
  547.    --  Descr: Width of the vertical border around the tab labels 
  548.    -- 
  549.    --  Name: Show_Tabs_Property 
  550.    --  Type: Boolean 
  551.    --  See:  Set_Show_Tabs / Get_Show_Tabs 
  552.    -- 
  553.    --  Name: Show_Border_Property 
  554.    --  Type: Boolean 
  555.    --  See:  Set_Show_Border / Get_Show_Border 
  556.    -- 
  557.    --  Name: Scrollable_Property 
  558.    --  Type: Boolean 
  559.    --  See:  Set_Scrollable / Get_Scrollable 
  560.    -- 
  561.    --  Name: Enable_Popup_Property 
  562.    --  Type: Boolean 
  563.    --  See:  Popup_Enable / Popup_Disable 
  564.    -- 
  565.    --  Name: Homogeneous_Property 
  566.    --  Type: Boolean 
  567.    --  See:  Set_Homogeneous_Tabs / - 
  568.    -- 
  569.    --  Name:  Group_Property 
  570.    --  Type:  Gtk_Notebook_Group 
  571.    --  Descr: Group for tabs drag and drop 
  572.    -- 
  573.    --  Name:  Group_Id_Property 
  574.    --  Type:  Int 
  575.    --  See: Set_Group_Id / Get_Group_Id 
  576.    --  </properties> 
  577.  
  578.    Page_Property         : constant Glib.Properties.Property_Int; 
  579.    Tab_Pos_Property      : constant Gtk.Enums.Property_Gtk_Position_Type; 
  580.    Tab_Border_Property   : constant Glib.Properties.Property_Uint; 
  581.    Tab_Hborder_Property  : constant Glib.Properties.Property_Uint; 
  582.    Tab_Vborder_Property  : constant Glib.Properties.Property_Uint; 
  583.    Show_Tabs_Property    : constant Glib.Properties.Property_Boolean; 
  584.    Show_Border_Property  : constant Glib.Properties.Property_Boolean; 
  585.    Scrollable_Property   : constant Glib.Properties.Property_Boolean; 
  586.    Enable_Popup_Property : constant Glib.Properties.Property_Boolean; 
  587.    Homogeneous_Property  : constant Glib.Properties.Property_Boolean; 
  588.    Group_Property        : constant Glib.Properties.Property_C_Proxy; 
  589.    Group_Id_Property     : constant Glib.Properties.Property_Int; 
  590.  
  591.    ---------------------- 
  592.    -- Child Properties -- 
  593.    ---------------------- 
  594.    --  The following properties can be set on children of this widget. See 
  595.    --  in particular Gtk.Containers.Child_Set_Property. 
  596.  
  597.    --  <child_properties> 
  598.    --  Name:  Menu_Label_Property 
  599.    --  Type:  String 
  600.    --  Descr: The string displayed in the child's menu entry 
  601.    -- 
  602.    --  Name:  Position_Property 
  603.    --  Type:  Int 
  604.    --  Descr: The index of the child in the parent 
  605.    -- 
  606.    --  Name:  Tab_Expand_Property 
  607.    --  Type:  Boolean 
  608.    --  Descr: Whether to expand the child's tab or not 
  609.    -- 
  610.    --  Name:  Tab_Fill_Property 
  611.    --  Type:  Boolean 
  612.    --  Descr: Whether the child's tab should fill the allocated area or not 
  613.    -- 
  614.    --  Name:  Tab_Label_Property 
  615.    --  Type:  String 
  616.    --  Descr: The string displayed on the child's tab label 
  617.    -- 
  618.    --  Name:  Tab_Pack_Property 
  619.    --  Type:  Enum 
  620.    --  Descr: A Gtk_Pack_Type indicating whether the child is packed with 
  621.    --  reference to the start or end of the parent 
  622.    -- 
  623.    --  Name:  Detachable_Property 
  624.    --  Type:  Boolean 
  625.    --  See:   Set_Tab_Detachable / Get_Tab_Detachable 
  626.    -- 
  627.    --  Name:  Reorderable_Property 
  628.    --  Type:  Boolean 
  629.    --  See:   Set_Tab_Reorderable / Get_Tab_Reorderable 
  630.    --  </child_properties> 
  631.  
  632.    Menu_Label_Property : constant Glib.Properties.Property_String; 
  633.    Position_Property   : constant Glib.Properties.Property_Int; 
  634.    Tab_Expand_Property : constant Glib.Properties.Property_Boolean; 
  635.    Tab_Fill_Property   : constant Glib.Properties.Property_Boolean; 
  636.    Tab_Label_Property  : constant Glib.Properties.Property_String; 
  637.    Tab_Pack_Property   : constant Gtk.Enums.Property_Pack_Type; 
  638.    Detachable_Property : constant Glib.Properties.Property_Boolean; 
  639.    Reorderable_Property : constant Glib.Properties.Property_Boolean; 
  640.  
  641.    ---------------------- 
  642.    -- Style Properties -- 
  643.    ---------------------- 
  644.    --  The following properties can be changed through the gtk theme and 
  645.    --  configuration files, and retrieved through Gtk.Widget.Style_Get_Property 
  646.  
  647.    --  <style_properties> 
  648.    --  Name:  Arrow_Spacing_Property 
  649.    --  Type:  Int 
  650.    --  Descr: Scroll arrow spacing 
  651.    -- 
  652.    --  Name:  Has_Backward_Stepper_Property 
  653.    --  Type:  Boolean 
  654.    --  Descr: Display the standard backward arrow button 
  655.    -- 
  656.    --  Name:  Has_Forward_Stepper_Property 
  657.    --  Type:  Boolean 
  658.    --  Descr: Display the standard forward arrow button 
  659.    -- 
  660.    --  Name:  Has_Secondary_Backward_Stepper_Property 
  661.    --  Type:  Boolean 
  662.    --  Descr: Display a second backward arrow button on the opposite end of the 
  663.    --         tab area 
  664.    -- 
  665.    --  Name:  Has_Secondary_Forward_Stepper_Property 
  666.    --  Type:  Boolean 
  667.    --  Descr: Display a second forward arrow button on the opposite end of the 
  668.    --         tab area 
  669.    -- 
  670.    --  Name:  Tab_Curvature_Property 
  671.    --  Type:  Int 
  672.    --  Descr: Size of tab curvature 
  673.    -- 
  674.    --  Name:  Tab_Overlap_Property 
  675.    --  Type:  Int 
  676.    --  Descr: Size of tab overlap area 
  677.    --  </style_properties> 
  678.  
  679.    Arrow_Spacing_Property        : constant Glib.Properties.Property_Int; 
  680.    Has_Backward_Stepper_Property : constant Glib.Properties.Property_Boolean; 
  681.    Has_Forward_Stepper_Property  : constant Glib.Properties.Property_Boolean; 
  682.    Has_Secondary_Backward_Stepper_Property : constant 
  683.      Glib.Properties.Property_Boolean; 
  684.    Has_Secondary_Forward_Stepper_Property  : constant 
  685.      Glib.Properties.Property_Boolean; 
  686.    Tab_Curvature_Property        : constant Glib.Properties.Property_Int; 
  687.    Tab_Overlap_Property          : constant Glib.Properties.Property_Int; 
  688.  
  689.    ------------- 
  690.    -- Signals -- 
  691.    ------------- 
  692.  
  693.    --  <signals> 
  694.    --  The following new signals are defined for this widget: 
  695.    -- 
  696.    --  - "switch_page" 
  697.    --    procedure Handler 
  698.    --      (Notebook : access Gtk_Notebook_Record'Class; 
  699.    --       Page     : Gtk_Notebook_Page; 
  700.    --       Page_Num : Guint); 
  701.    --   Notify when the current page is modified in the notebook. 
  702.    --   This is called every time the user selected a new page, or the 
  703.    --   program selected a new page with Next_Page, Prev_Page, ... 
  704.    -- 
  705.    --  - "select_page" 
  706.    --    function Handler 
  707.    --      (Notebook   : access Gtk_Notebook_Record'Class; 
  708.    --       Move_Focus : Boolean) return Boolean; 
  709.    --    You should emit this signal to request that the notebook selects the 
  710.    --    page corresponding to the focus tab. If Move_Focus is true, the page 
  711.    --    acquires the keyboard focus. 
  712.    --    Seldom used. 
  713.    -- 
  714.    --  - "focus_tab" 
  715.    --    function Handler 
  716.    --       (Notebook : access Gtk_Notebook_Record'Class; 
  717.    --        Tab      : Gtk_Notebook_Tab) return Boolean; 
  718.    --    Gives the focus to one of the tabs in the notebook. This signal is 
  719.    --    mostly used as a keybinding for Home, End,... so that the proper 
  720.    --    behavior can be implemented 
  721.    -- 
  722.    --  - "move_focus_out" 
  723.    --    procedure Handler 
  724.    --      (Notebook  : access Gtk_Notebook_Record'Class; 
  725.    --       Direction : Gtk_Direction_Type); 
  726.    --    You should emit this signal to request that the focus be transfered 
  727.    --    from the current page to the parent widget. 
  728.    --    Seldom used. 
  729.    -- 
  730.    --  - "change_current_page" 
  731.    --    procedure Handler 
  732.    --      (Notebook : access Gtk_Notebook_Record'Class; 
  733.    --       Offset   : Gint); 
  734.    --    You should emit this signal to request that the notebook selects 
  735.    --    another page as the current page. The offset is relative to the 
  736.    --    currently selected page. 
  737.    -- 
  738.    --  </signals> 
  739.  
  740.    Signal_Switch_Page         : constant Glib.Signal_Name := "switch_page"; 
  741.    Signal_Select_Page         : constant Glib.Signal_Name := "select_page"; 
  742.    Signal_Focus_Tab           : constant Glib.Signal_Name := "focus_tab"; 
  743.    Signal_Move_Focus_Out      : constant Glib.Signal_Name := "move_focus_out"; 
  744.    Signal_Change_Current_Page : constant Glib.Signal_Name := 
  745.                                   "change_current_page"; 
  746.  
  747. private 
  748.    type Gtk_Notebook_Record is new Gtk.Container.Gtk_Container_Record 
  749.      with null record; 
  750.    pragma Import (C, Get_Type, "gtk_notebook_get_type"); 
  751.  
  752.    Page_Property : constant Glib.Properties.Property_Int := 
  753.      Glib.Properties.Build ("page"); 
  754.    Tab_Pos_Property : constant Gtk.Enums.Property_Gtk_Position_Type := 
  755.      Gtk.Enums.Build ("tab-pos"); 
  756.    Tab_Border_Property : constant Glib.Properties.Property_Uint := 
  757.      Glib.Properties.Build ("tab-border"); 
  758.    Tab_Hborder_Property : constant Glib.Properties.Property_Uint := 
  759.      Glib.Properties.Build ("tab-hborder"); 
  760.    Tab_Vborder_Property : constant Glib.Properties.Property_Uint := 
  761.      Glib.Properties.Build ("tab-vborder"); 
  762.    Show_Tabs_Property   : constant Glib.Properties.Property_Boolean := 
  763.      Glib.Properties.Build ("show-tabs"); 
  764.    Show_Border_Property   : constant Glib.Properties.Property_Boolean := 
  765.      Glib.Properties.Build ("show-border"); 
  766.    Scrollable_Property   : constant Glib.Properties.Property_Boolean := 
  767.      Glib.Properties.Build ("scrollable"); 
  768.    Enable_Popup_Property   : constant Glib.Properties.Property_Boolean := 
  769.      Glib.Properties.Build ("enable-popup"); 
  770.    Homogeneous_Property  : constant Glib.Properties.Property_Boolean := 
  771.      Glib.Properties.Build ("homogeneous"); 
  772.    Group_Property : constant Glib.Properties.Property_C_Proxy := 
  773.      Glib.Properties.Build ("group"); 
  774.    Group_Id_Property : constant Glib.Properties.Property_Int := 
  775.      Glib.Properties.Build ("group-id"); 
  776.  
  777.    Menu_Label_Property : constant Glib.Properties.Property_String := 
  778.      Glib.Properties.Build ("menu-label"); 
  779.    Position_Property : constant Glib.Properties.Property_Int := 
  780.      Glib.Properties.Build ("position"); 
  781.    Tab_Expand_Property : constant Glib.Properties.Property_Boolean := 
  782.      Glib.Properties.Build ("tab-expand"); 
  783.    Tab_Fill_Property : constant Glib.Properties.Property_Boolean := 
  784.      Glib.Properties.Build ("tab-fill"); 
  785.    Tab_Label_Property : constant Glib.Properties.Property_String := 
  786.      Glib.Properties.Build ("tab-label"); 
  787.    Tab_Pack_Property : constant Gtk.Enums.Property_Pack_Type := 
  788.      Gtk.Enums.Build ("tab-pack"); 
  789.    Detachable_Property : constant Glib.Properties.Property_Boolean := 
  790.      Glib.Properties.Build ("detachable"); 
  791.    Reorderable_Property : constant Glib.Properties.Property_Boolean := 
  792.      Glib.Properties.Build ("reorderable"); 
  793.  
  794.    Arrow_Spacing_Property : constant Glib.Properties.Property_Int := 
  795.      Glib.Properties.Build ("arrow-spacing"); 
  796.    Has_Backward_Stepper_Property : constant Glib.Properties.Property_Boolean := 
  797.      Glib.Properties.Build ("has-backward-stepper"); 
  798.    Has_Forward_Stepper_Property : constant Glib.Properties.Property_Boolean := 
  799.      Glib.Properties.Build ("has-forward-stepper"); 
  800.    Has_Secondary_Backward_Stepper_Property : constant 
  801.      Glib.Properties.Property_Boolean := 
  802.      Glib.Properties.Build ("has-secondary-backward-stepper"); 
  803.    Has_Secondary_Forward_Stepper_Property : constant 
  804.      Glib.Properties.Property_Boolean := 
  805.      Glib.Properties.Build ("has-secondary-forward-stepper"); 
  806.    Tab_Curvature_Property : constant Glib.Properties.Property_Int := 
  807.      Glib.Properties.Build ("tab-curvature"); 
  808.    Tab_Overlap_Property : constant Glib.Properties.Property_Int := 
  809.      Glib.Properties.Build ("tab-overlap"); 
  810.  
  811. end Gtk.Notebook;