1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                  Copyright (C) 2006-2010, AdaCore                 -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  This package defines a special kind of menu, that can be inserted in a 
  26. --  toolbar. This is not something used very often, as in general a toolbar 
  27. --  provides a quick access to features that are already accessible in the 
  28. --  menu bar itself. 
  29. --  In practice, it is used internally by gtk+ itself to implement the 
  30. --  overflow menu in the toolbar. 
  31. --  </description> 
  32. --  <c_version>2.16.6</c_version> 
  33. --  <group>Menus and Toolbars</group> 
  34.  
  35. with Glib.Properties; 
  36. with Gtk.Menu; 
  37. with Gtk.Tool_Button; 
  38. with Gtk.Tooltips; 
  39. with Gtk.Widget; 
  40.  
  41. package Gtk.Menu_Tool_Button is 
  42.  
  43.    type Gtk_Menu_Tool_Button_Record is 
  44.      new Gtk.Tool_Button.Gtk_Tool_Button_Record with null record; 
  45.    type Gtk_Menu_Tool_Button is access all Gtk_Menu_Tool_Button_Record'Class; 
  46.  
  47.    procedure Gtk_New 
  48.      (Menu        : out Gtk_Menu_Tool_Button; 
  49.       Icon_Widget : Gtk.Widget.Gtk_Widget := null; 
  50.       Label       : String := ""); 
  51.    procedure Initialize 
  52.      (Menu        : access Gtk_Menu_Tool_Button_Record'Class; 
  53.       Icon_Widget : Gtk.Widget.Gtk_Widget := null; 
  54.       Label       : String := ""); 
  55.    --  Create a new menu by specifying explicitly the text that should appear 
  56.    --  on its button. When the button is clicked on, the menu is displayed. 
  57.  
  58.    procedure Gtk_New_From_Stock 
  59.      (Menu     : out Gtk_Menu_Tool_Button; 
  60.       Stock_Id : String); 
  61.    procedure Initialize_From_Stock 
  62.      (Menu     : access Gtk_Menu_Tool_Button_Record'Class; 
  63.       Stock_Id : String); 
  64.    --  Create a new menu. The label and icon of its button are read from 
  65.    --  stock items (see gtk-stock.ads) 
  66.  
  67.    function Get_Type return GType; 
  68.    --  Return the internal type used for this class of widgets 
  69.  
  70.    procedure Set_Menu 
  71.      (Button : access Gtk_Menu_Tool_Button_Record; 
  72.       Menu   : access Gtk.Menu.Gtk_Menu_Record'Class); 
  73.    function Get_Menu 
  74.      (Button : access Gtk_Menu_Tool_Button_Record) 
  75.       return Gtk.Menu.Gtk_Menu; 
  76.    --  Set or Get the menu that it displayed when the button is clicked on 
  77.  
  78.    procedure Set_Arrow_Tooltip 
  79.      (Button      : access Gtk_Menu_Tool_Button_Record; 
  80.       Tooltips    : access Gtk.Tooltips.Gtk_Tooltips_Record'Class; 
  81.       Tip_Text    : String; 
  82.       Tip_Private : String := ""); 
  83.    pragma Obsolescent; --  Set_Arrow_Tooltip 
  84.    --  Set the tooltip set on the arrow button that will display the menu when 
  85.    --  clicked on. 
  86.    -- 
  87.    --  Set_Arrow_Tooltip has been deprecated since version 2.12 and should 
  88.    --  not be used in newly-written code. Use Set_Arrow_Tooltip_Text instead. 
  89.  
  90.    procedure Set_Arrow_Tooltip_Markup 
  91.      (Button : access Gtk_Menu_Tool_Button_Record; 
  92.       Markup : String); 
  93.    --  Sets the tooltip markup text to be used as tooltip for the arrow button 
  94.    --  which pops up the menu.  See Gtk.Tool_Item.Set_Tooltip for setting a 
  95.    --  tooltip on the whole Gtk_Menu_Tool_Button. 
  96.  
  97.    procedure Set_Arrow_Tooltip_Text 
  98.      (Button : access Gtk_Menu_Tool_Button_Record; 
  99.       Text   : String); 
  100.    --  Sets the tooltip text to be used as tooltip for the arrow button which 
  101.    --  pops up the menu.  See Gtk.Tool_Item.Set_Tooltip for setting a tooltip 
  102.    --  on the whole Gtk_Menu_Tool_Button. 
  103.  
  104.    ------------- 
  105.    -- Signals -- 
  106.    ------------- 
  107.  
  108.    --  <signals> 
  109.    --  The following new signals are defined for this widget: 
  110.    -- 
  111.    --  - "show-menu" 
  112.    --    procedure Handler (Menu : access Gtk_Menu_Tool_Button_Record'Class); 
  113.    --    Emitted when the menu is being displayed 
  114.    -- 
  115.    --  </signals> 
  116.  
  117.    Signal_Show_Menu : constant Glib.Signal_Name := "show-menu"; 
  118.  
  119.    ---------------- 
  120.    -- Properties -- 
  121.    ---------------- 
  122.  
  123.    --  <properties> 
  124.    --  The following properties are defined for this widget. See 
  125.    --  Glib.Properties for more information on properties. 
  126.    -- 
  127.    --  Name: Menu_Property 
  128.    --  Type: Object 
  129.    --  See : Set_Menu / Get_Menu 
  130.    -- 
  131.    --  </properties> 
  132.  
  133.    Menu_Property : constant Glib.Properties.Property_Object; 
  134.  
  135. private 
  136.    Menu_Property : constant Glib.Properties.Property_Object := 
  137.      Glib.Properties.Build ("menu"); 
  138.    pragma Import (C, Get_Type, "gtk_menu_tool_button_get_type"); 
  139.  
  140. end Gtk.Menu_Tool_Button;