1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                  Copyright (C) 2006-2013, 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. -- As a special exception, if other files instantiate generics from  -- 
  22. -- this unit, or you link this unit with other files to produce an   -- 
  23. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  24. -- executable to be covered by the GNU General Public License. This  -- 
  25. -- exception does not however invalidate any other reasons why the   -- 
  26. -- executable file  might be covered by the  GNU Public License.     -- 
  27. ----------------------------------------------------------------------- 
  28.  
  29. --  <description> 
  30. --  This package defines a special kind of menu, that can be inserted in a 
  31. --  toolbar. This is not something used very often, as in general a toolbar 
  32. --  provides a quick access to features that are already accessible in the 
  33. --  menu bar itself. 
  34. --  In practice, it is used internally by gtk+ itself to implement the 
  35. --  overflow menu in the toolbar. 
  36. --  </description> 
  37. --  <c_version>2.16.6</c_version> 
  38. --  <group>Menus and Toolbars</group> 
  39.  
  40. with Glib.Properties; 
  41. with Gtk.Menu; 
  42. with Gtk.Tool_Button; 
  43. with Gtk.Tooltips; 
  44. with Gtk.Widget; 
  45.  
  46. package Gtk.Menu_Tool_Button is 
  47.  
  48.    type Gtk_Menu_Tool_Button_Record is 
  49.      new Gtk.Tool_Button.Gtk_Tool_Button_Record with null record; 
  50.    type Gtk_Menu_Tool_Button is access all Gtk_Menu_Tool_Button_Record'Class; 
  51.  
  52.    procedure Gtk_New 
  53.      (Menu        : out Gtk_Menu_Tool_Button; 
  54.       Icon_Widget : Gtk.Widget.Gtk_Widget := null; 
  55.       Label       : String := ""); 
  56.    procedure Initialize 
  57.      (Menu        : access Gtk_Menu_Tool_Button_Record'Class; 
  58.       Icon_Widget : Gtk.Widget.Gtk_Widget := null; 
  59.       Label       : String := ""); 
  60.    --  Create a new menu by specifying explicitly the text that should appear 
  61.    --  on its button. When the button is clicked on, the menu is displayed. 
  62.  
  63.    procedure Gtk_New_From_Stock 
  64.      (Menu     : out Gtk_Menu_Tool_Button; 
  65.       Stock_Id : String); 
  66.    procedure Initialize_From_Stock 
  67.      (Menu     : access Gtk_Menu_Tool_Button_Record'Class; 
  68.       Stock_Id : String); 
  69.    --  Create a new menu. The label and icon of its button are read from 
  70.    --  stock items (see gtk-stock.ads) 
  71.  
  72.    function Get_Type return GType; 
  73.    --  Return the internal type used for this class of widgets 
  74.  
  75.    procedure Set_Menu 
  76.      (Button : access Gtk_Menu_Tool_Button_Record; 
  77.       Menu   : access Gtk.Menu.Gtk_Menu_Record'Class); 
  78.    function Get_Menu 
  79.      (Button : access Gtk_Menu_Tool_Button_Record) 
  80.       return Gtk.Menu.Gtk_Menu; 
  81.    --  Set or Get the menu that it displayed when the button is clicked on 
  82.  
  83.    procedure Set_Arrow_Tooltip 
  84.      (Button      : access Gtk_Menu_Tool_Button_Record; 
  85.       Tooltips    : access Gtk.Tooltips.Gtk_Tooltips_Record'Class; 
  86.       Tip_Text    : String; 
  87.       Tip_Private : String := ""); 
  88.    pragma Obsolescent; --  Set_Arrow_Tooltip 
  89.    --  Set the tooltip set on the arrow button that will display the menu when 
  90.    --  clicked on. 
  91.    -- 
  92.    --  Set_Arrow_Tooltip has been deprecated since version 2.12 and should 
  93.    --  not be used in newly-written code. Use Set_Arrow_Tooltip_Text instead. 
  94.  
  95.    procedure Set_Arrow_Tooltip_Markup 
  96.      (Button : access Gtk_Menu_Tool_Button_Record; 
  97.       Markup : String); 
  98.    --  Sets the tooltip markup text to be used as tooltip for the arrow button 
  99.    --  which pops up the menu.  See Gtk.Tool_Item.Set_Tooltip for setting a 
  100.    --  tooltip on the whole Gtk_Menu_Tool_Button. 
  101.  
  102.    procedure Set_Arrow_Tooltip_Text 
  103.      (Button : access Gtk_Menu_Tool_Button_Record; 
  104.       Text   : String); 
  105.    --  Sets the tooltip text to be used as tooltip for the arrow button which 
  106.    --  pops up the menu.  See Gtk.Tool_Item.Set_Tooltip for setting a tooltip 
  107.    --  on the whole Gtk_Menu_Tool_Button. 
  108.  
  109.    ------------- 
  110.    -- Signals -- 
  111.    ------------- 
  112.  
  113.    --  <signals> 
  114.    --  The following new signals are defined for this widget: 
  115.    -- 
  116.    --  - "show-menu" 
  117.    --    procedure Handler (Menu : access Gtk_Menu_Tool_Button_Record'Class); 
  118.    --    Emitted when the menu is being displayed 
  119.    -- 
  120.    --  </signals> 
  121.  
  122.    Signal_Show_Menu : constant Glib.Signal_Name := "show-menu"; 
  123.  
  124.    ---------------- 
  125.    -- Properties -- 
  126.    ---------------- 
  127.  
  128.    --  <properties> 
  129.    --  The following properties are defined for this widget. See 
  130.    --  Glib.Properties for more information on properties. 
  131.    -- 
  132.    --  Name: Menu_Property 
  133.    --  Type: Object 
  134.    --  See : Set_Menu / Get_Menu 
  135.    -- 
  136.    --  </properties> 
  137.  
  138.    Menu_Property : constant Glib.Properties.Property_Object; 
  139.  
  140. private 
  141.    Menu_Property : constant Glib.Properties.Property_Object := 
  142.      Glib.Properties.Build ("menu"); 
  143.    pragma Import (C, Get_Type, "gtk_menu_tool_button_get_type"); 
  144.  
  145. end Gtk.Menu_Tool_Button;