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-2011, 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. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  <description> 
  26. --  A Gtk_Notebook is a container that displays all of its children at the 
  27. --  same location on the screen. They are organized into pages, that can be 
  28. --  selected through tabs (either by clicking on them or by a contextual 
  29. --  menu). 
  30. --  This is the best way to organize complicated interfaces that have a lot 
  31. --  of widgets, by putting the children into groups of coherent widgets. 
  32. -- 
  33. --  You can hide some of the pages of the notebook by simply calling Hide on 
  34. --  the widget that is contained in the page (or returned from Get_Nth_Page). 
  35. --  </description> 
  36. --  <c_version>2.16.6</c_version> 
  37. --  <group>Layout containers</group> 
  38. --  <testgtk>create_notebook.adb</testgtk> 
  39. --  <screenshot>gtk-notebook</screenshot> 
  40.  
  41. with Glib.Glist; 
  42. pragma Elaborate_All (Glib.Glist); 
  43. with Glib.Properties; 
  44. with Glib.Values; 
  45. with Gtk.Container; 
  46. with Gtk.Enums; 
  47. with Gtk.Widget; 
  48. with Unchecked_Conversion; 
  49.  
  50. package Gtk.Notebook is 
  51.  
  52.    type Gtk_Notebook_Record is new Gtk.Container.Gtk_Container_Record 
  53.      with private; 
  54.    type Gtk_Notebook is access all Gtk_Notebook_Record'Class; 
  55.  
  56.    subtype Gtk_Notebook_Page is Gtk.Gtk_Notebook_Page; 
  57.  
  58.    type Gtk_Notebook_Tab is 
  59.      (Notebook_Tab_First, 
  60.       Notebook_Tab_Last); 
  61.    pragma Convention (C, Gtk_Notebook_Tab); 
  62.  
  63.    subtype Gtk_Notebook_Group is Glib.C_Proxy; 
  64.  
  65.    --------------------------------------------- 
  66.    -- Creating a notebook and inserting pages -- 
  67.    --------------------------------------------- 
  68.  
  69.    procedure Gtk_New (Widget : out Gtk_Notebook); 
  70.    --  Create a new empty notebook. 
  71.  
  72.    procedure Initialize (Widget : access Gtk_Notebook_Record'Class); 
  73.    --  Internal initialization function. 
  74.    --  See the section "Creating your own widgets" in the documentation. 
  75.  
  76.    function Get_Type return Gtk.Gtk_Type; 
  77.    --  Return the internal value associated with a Gtk_Notebook. 
  78.  
  79.    procedure Append_Page 
  80.      (Notebook  : access Gtk_Notebook_Record; 
  81.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  82.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  83.    --  Insert a new page in Notebook. 
  84.    --  The page is put at the end of the list of pages. 
  85.    --  The user will select it through a button that contains the 
  86.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  87.    --  with a pixmap in it for instance. 
  88.    --  No entry is associated with the page in the contextual menu. 
  89.  
  90.    procedure Append_Page 
  91.      (Notebook  : access Gtk_Notebook_Record; 
  92.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class); 
  93.    --  Same as above, but no label is specified. 
  94.  
  95.    procedure Append_Page_Menu 
  96.      (Notebook   : access Gtk_Notebook_Record; 
  97.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  98.       Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class; 
  99.       Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  100.    --  Insert a new page in Notebook. 
  101.    --  The page is put at the end of the list of pages. 
  102.    --  The user will select it through a button that contains the 
  103.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  104.    --  with a pixmap in it for instance. 
  105.    --  A new entry is inserted into the contextual menu. This new entry is 
  106.    --  made with Menu_Label. 
  107.  
  108.    procedure Prepend_Page 
  109.      (Notebook  : access Gtk_Notebook_Record; 
  110.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  111.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  112.    --  Insert a new page in Notebook. 
  113.    --  The page is put at the beginning of the list of pages. 
  114.    --  The user will select it through a button that contains the 
  115.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  116.    --  with a pixmap in it for instance. 
  117.    --  No entry is associated with the page in the contextual menu. 
  118.  
  119.    procedure Prepend_Page_Menu 
  120.      (Notebook   : access Gtk_Notebook_Record; 
  121.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  122.       Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class; 
  123.       Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  124.    --  Insert a new page in Notebook. 
  125.    --  The page is put at the beginning of the list of pages. 
  126.    --  The user will select it through a button that contains the 
  127.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  128.    --  with a pixmap in it for instance. 
  129.    --  A new entry is inserted into the contextual menu. This new entry is 
  130.    --  made with Menu_Label. 
  131.  
  132.    procedure Insert_Page 
  133.      (Notebook  : access Gtk_Notebook_Record; 
  134.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  135.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class; 
  136.       Position  : Gint); 
  137.    --  Insert a new page at a specific position in Notebook. 
  138.    --  The page is put at the beginning of the list of pages. 
  139.    --  The user will select it through a button that contains the 
  140.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  141.    --  with a pixmap in it for instance. 
  142.    --  No entry is associated with the page in the contextual menu. 
  143.    --  The first position in the list of pages is 0. 
  144.  
  145.    procedure Insert_Page_Menu 
  146.      (Notebook   : access Gtk_Notebook_Record; 
  147.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  148.       Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class; 
  149.       Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class; 
  150.       Position   : Gint); 
  151.    --  Insert a new page at a specific position in Notebook. 
  152.    --  The page is put at the beginning of the list of pages. 
  153.    --  The user will select it through a button that contains the 
  154.    --  Tab_Label widget, which is generally a Gtk_Label, but could be a box 
  155.    --  with a pixmap in it for instance. 
  156.    --  A new entry is inserted into the contextual menu. This new entry is 
  157.    --  made with Menu_Label. 
  158.    --  The first position in the list of pages is 0. 
  159.  
  160.    procedure Remove_Page 
  161.      (Notebook : access Gtk_Notebook_Record; Page_Num : Gint); 
  162.    --  Remove a page from the notebook. 
  163.    --  The first position in the list of pages is 0. 
  164.  
  165.    ------------------------ 
  166.    -- Tabs drag and drop -- 
  167.    ------------------------ 
  168.  
  169.    type Gtk_Notebook_Window_Creation_Func is access 
  170.      function (Source : System.Address; --  Gtk_Notebook 
  171.                Page   : System.Address; --  Gtk_Widget 
  172.                X      : System.Address; --  Gint 
  173.                Y      : System.Address; --  Gint 
  174.                Data   : System.Address) return Gtk_Notebook; 
  175.    pragma Convention (C, Gtk_Notebook_Window_Creation_Func); 
  176.  
  177.    procedure Set_Window_Creation_Hook 
  178.      (Func     : Gtk_Notebook_Window_Creation_Func; 
  179.       Data     : System.Address; 
  180.       Destroy  : Glib.G_Destroy_Notify_Address); 
  181.    pragma Obsolescent (Set_Window_Creation_Hook); 
  182.    --  Install a global function used to create a window when a detached tab 
  183.    --  is dropped in an empty area. 
  184.  
  185.    -------------------------------------------- 
  186.    -- Modifying and getting the current page -- 
  187.    -------------------------------------------- 
  188.  
  189.    function Get_Current_Page 
  190.      (Notebook : access Gtk_Notebook_Record) return Gint; 
  191.    --  Get the number of the current page. 
  192.    --  The first page has the number 0. 
  193.  
  194.    function Get_Nth_Page 
  195.      (Widget   : access Gtk_Notebook_Record'Class; 
  196.       Page_Num : Gint) return Gtk.Widget.Gtk_Widget; 
  197.    --  Convert from a page number to the real page. 
  198.  
  199.    function Get_N_Pages 
  200.      (Notebook : access Gtk_Notebook_Record) return Gint; 
  201.    --  Return the number of pages in the notebook 
  202.  
  203.    function Page_Num 
  204.      (Widget : access Gtk_Notebook_Record'Class; 
  205.       Child  : access Gtk.Widget.Gtk_Widget_Record'Class) return Gint; 
  206.    --  Convert from a child to a page number. 
  207.    --  Note that Child is not the notebook page, but the widget you inserted 
  208.    --  with Insert_Page, Append_Page,... 
  209.  
  210.    procedure Set_Current_Page 
  211.      (Notebook : access Gtk_Notebook_Record; 
  212.       Page_Num : Gint := -1); 
  213.    --  Modify the current page. 
  214.    --  The current page is the page that is currently visible on the screen. 
  215.    --  Nothing happens if there is no such page. 
  216.    --  Note also that the page has to be visible on the screen (ie you must 
  217.    --  have called Gtk.Widget.Show on it first). 
  218.    --  Use -1 to set the current page to the last one. 
  219.    -- 
  220.    --  Note: This call won't succeeded unless you have called Show on the 
  221.    --  widget displayed in the page. 
  222.  
  223.    procedure Set_Page 
  224.      (Notebook : access Gtk_Notebook_Record; 
  225.       Page_Num : Gint := -1) 
  226.      renames Set_Current_Page; 
  227.    --  This function is deprecated. Use Set_Current_Page instead. 
  228.  
  229.    procedure Next_Page (Notebook : access Gtk_Notebook_Record); 
  230.    --  Display the next page on the screen. 
  231.  
  232.    procedure Prev_Page (Notebook : access Gtk_Notebook_Record); 
  233.    --  Display the previous page on the screen. 
  234.  
  235.    ----------------------------- 
  236.    -- Style and visual aspect -- 
  237.    ----------------------------- 
  238.  
  239.    procedure Set_Show_Border 
  240.      (Notebook    : access Gtk_Notebook_Record; 
  241.       Show_Border : Boolean := True); 
  242.    --  Indicate whether the notebook should display borders. 
  243.    --  This border gives a 3D aspect to the notebook. 
  244.  
  245.    function Get_Show_Border 
  246.      (Notebook : access Gtk_Notebook_Record) return Boolean; 
  247.    --  Return whether the notebook displays borders. 
  248.  
  249.    procedure Set_Show_Tabs 
  250.      (Notebook  : access Gtk_Notebook_Record; 
  251.       Show_Tabs : Boolean := True); 
  252.    --  Indicate whether the tabs should be displayed. 
  253.    --  If the tabs are not displayed, the only way for the user to select a 
  254.    --  new page is through the contextual menu, and thus you should make sure 
  255.    --  that the pages were created with the Insert_Page_Menu, ... subprograms. 
  256.  
  257.    function Get_Show_Tabs 
  258.      (Notebook : access Gtk_Notebook_Record) return Boolean; 
  259.    --  Return whether the tabs are displayed. 
  260.  
  261.    procedure Set_Tab_Pos 
  262.      (Notebook : access Gtk_Notebook_Record; 
  263.       Pos      : Gtk.Enums.Gtk_Position_Type); 
  264.    --  Change the position of the tabs. 
  265.    --  The tabs can be displayed on any of the four sides of the notebook. 
  266.  
  267.    function Get_Tab_Pos 
  268.      (Widget : access Gtk_Notebook_Record) return Gtk.Enums.Gtk_Position_Type; 
  269.    --  Return the current position of the tabs. 
  270.  
  271.    procedure Set_Scrollable 
  272.      (Notebook   : access Gtk_Notebook_Record; 
  273.       Scrollable : Boolean := True); 
  274.    --  Indicate whether Notebook display scrolling arrows when there are 
  275.    --  too many tabs. 
  276.    --  The default is not to display such scrolling arrows. Note also that 
  277.    --  a notebook with too many pages, even if the scrolling is activated, 
  278.    --  is sometimes hard to use for the user. 
  279.  
  280.    function Get_Scrollable 
  281.      (Notebook : access Gtk_Notebook_Record) return Boolean; 
  282.    --  Return whether Notebook is scrollable. 
  283.    --  See Set_Scrollable for more details. 
  284.  
  285.    ---------------- 
  286.    -- Popup Menu -- 
  287.    ---------------- 
  288.    --  The pages of a notebook can be selected both via tabs and a contextual 
  289.    --  menu (right mouse button). Note however that the menu is available only 
  290.    --  if the pages were inserted with Insert_Page_Menu, Append_Page_Menu or 
  291.    --  Prepend_Page_Menu. 
  292.  
  293.    procedure Popup_Enable (Notebook : access Gtk_Notebook_Record); 
  294.    --  Enable the popup menu. 
  295.    --  When the user pressed the right mouse button, a menu is selected that 
  296.    --  allows him to select a new page. 
  297.  
  298.    procedure Popup_Disable (Notebook : access Gtk_Notebook_Record); 
  299.    --  Disable the popup menu. 
  300.    --  This menu won't be display any more when the user pressed the right 
  301.    --  mouse button. 
  302.  
  303.    --------------------- 
  304.    -- Page properties -- 
  305.    --------------------- 
  306.  
  307.    function Get_Tab_Label 
  308.      (Notebook  : access Gtk_Notebook_Record; 
  309.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class) 
  310.       return Gtk.Widget.Gtk_Widget; 
  311.    --  Return the widget displayed in the tab used to select Page. 
  312.    --  This widget is in fact the one given in argument to Insert_Page,etc. 
  313.    --  when the page was created. 
  314.  
  315.    procedure Set_Tab_Label 
  316.      (Notebook  : access Gtk_Notebook_Record; 
  317.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  318.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  319.    --  Modify the widget displayed in the tab for the page that contains Child. 
  320.    --  Tab_Label is generally a Gtk_Label, although it can also be a Gtk_Box 
  321.    --  that contains a Gtk_Pixmap and a Gtk_Label if you want to show pixmaps. 
  322.    -- 
  323.    --  Note that you will need to call Show_All on Tab_Label: since it is not 
  324.    --  a Child of the notebook in the sense of Gtk_Container, the Show_All 
  325.    --  passed to the notebook will not be transmitted to the Tab_Label. 
  326.  
  327.    procedure Set_Tab_Label_Text 
  328.      (Notebook : access Gtk_Notebook_Record; 
  329.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  330.       Tab_Text : UTF8_String); 
  331.    --  Modify the text displayed in the tab for the page that contains Child. 
  332.    --  This is a less general form of Set_Tab_Label above. 
  333.  
  334.    function Get_Tab_Label_Text 
  335.      (Notebook : access Gtk_Notebook_Record; 
  336.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class) return UTF8_String; 
  337.    --  Return the text displayed in the tab for the page that contains Child. 
  338.  
  339.    procedure Set_Tab 
  340.      (Notebook  : access Gtk_Notebook_Record; 
  341.       Page_Num  : Gint; 
  342.       Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  343.    --  Set Notebook tab widget for a given page number. 
  344.    --  This function is mainly intended for use by Gate. 
  345.  
  346.    function Get_Menu_Label 
  347.      (Notebook : access Gtk_Notebook_Record; 
  348.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class) 
  349.       return Gtk.Widget.Gtk_Widget; 
  350.    --  Return the widget displayed in the contextual menu for the Child. 
  351.    --  This is the widget given in argument to Insert_Page_Menu, 
  352.    --  Append_Page_Menu and Prepend_Page_Menu. 
  353.  
  354.    procedure Set_Menu_Label 
  355.      (Notebook   : access Gtk_Notebook_Record; 
  356.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  357.       Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 
  358.    --  Modify the widget displayed in the contextual menu for the page 
  359.    --  that contains Child. 
  360.  
  361.    procedure Set_Menu_Label_Text 
  362.      (Notebook  : access Gtk_Notebook_Record; 
  363.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  364.       Menu_Text : UTF8_String); 
  365.    --  Modify the text displayed in the contextual menu for the page that 
  366.    --  contains Child. 
  367.    --  This is a less general form of Set_Menu_Label above. 
  368.  
  369.    function Get_Menu_Label_Text 
  370.      (Notebook  : access Gtk_Notebook_Record; 
  371.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class) 
  372.       return UTF8_String; 
  373.    --  Return the text displayed in the contextual menu for the page that 
  374.    --  contains Child. 
  375.  
  376.    procedure Query_Tab_Label_Packing 
  377.      (Notebook   : access Gtk_Notebook_Record; 
  378.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  379.       Expand     : out Boolean; 
  380.       Fill       : out Boolean; 
  381.       Pack_Type  : out Gtk.Enums.Gtk_Pack_Type); 
  382.    pragma Obsolescent (Query_Tab_Label_Packing); 
  383.    --  Return the packing used for the tab associated with the page 
  384.    --  that contains Child. 
  385.    --  See the Gtk.Box package for more information on the parameters. 
  386.  
  387.    procedure Set_Tab_Label_Packing 
  388.      (Notebook  : access Gtk_Notebook_Record; 
  389.       Child     : access Gtk.Widget.Gtk_Widget_Record'Class; 
  390.       Expand    : Boolean; 
  391.       Fill      : Boolean; 
  392.       Pack_Type : Gtk.Enums.Gtk_Pack_Type); 
  393.    pragma Obsolescent (Set_Tab_Label_Packing); 
  394.    --  Modify the packing used for the tab associated with the page that 
  395.    --  contains Child. 
  396.  
  397.    procedure Reorder_Child 
  398.      (Notebook : access Gtk_Notebook_Record; 
  399.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  400.       Position : Gint); 
  401.    --  Change the position of the page that contains Child. 
  402.  
  403.    function Get_Tab_Reorderable 
  404.      (Notebook : access Gtk_Notebook_Record; 
  405.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  406.       Position : Gint) 
  407.       return Boolean; 
  408.    --  Get whether the tab can be reordered via drag and drop or not. 
  409.  
  410.    procedure Set_Tab_Reorderable 
  411.      (Notebook    : access Gtk_Notebook_Record; 
  412.       Child       : access Gtk.Widget.Gtk_Widget_Record'Class; 
  413.       Reorderable : Boolean := True); 
  414.    --  Set whether the notebook tab can be reordered. 
  415.  
  416.    function Get_Tab_Detachable 
  417.      (Notebook : access Gtk_Notebook_Record; 
  418.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  419.       Position : Gint) 
  420.       return Boolean; 
  421.    --  Return whether the tab contents can be detached from Notebook. 
  422.  
  423.    procedure Set_Tab_Detachable 
  424.      (Notebook   : access Gtk_Notebook_Record; 
  425.       Child      : access Gtk.Widget.Gtk_Widget_Record'Class; 
  426.       Detachable : Boolean := True); 
  427.    --  Set whether the tab can be detached from Notebook to another 
  428.    --  notebook or widget. 
  429.    -- 
  430.    --  Note that 2 notebooks must share a common group identificator 
  431.    --  (see Set_Group_Id) to allow automatic tabs interchange between them. 
  432.    -- 
  433.    --  If you want a widget to interact with a notebook through DnD 
  434.    --  (i.e.: accept dragged tabs from it) it must be set as a drop 
  435.    --  destination and accept the target "GTK_NOTEBOOK_TAB". The notebook 
  436.    --  will fill the selection with a Gtk_Widget pointing to the child 
  437.    --  widget that corresponds to the dropped tab. 
  438.    -- 
  439.    --  If you want a notebook to accept drags from other widgets, 
  440.    --  you will have to set your own DnD code to do it. 
  441.  
  442.    function Get_Group (Notebook : access Gtk_Notebook_Record) 
  443.       return Gtk_Notebook_Group; 
  444.    pragma Obsolescent (Get_Group); 
  445.    procedure Set_Group 
  446.      (Notebook : access Gtk_Notebook_Record; 
  447.       Group    : Gtk_Notebook_Group); 
  448.    pragma Obsolescent (Set_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 (Get_Children); 
  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;