File: gtk-menu_tool_button.ads

package info (click to toggle)
libgtkada2 2.8.1-6lenny3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,496 kB
  • ctags: 3,886
  • sloc: ada: 103,189; ansic: 45,411; perl: 5,500; sh: 2,812; makefile: 1,169; xml: 19
file content (121 lines) | stat: -rw-r--r-- 4,772 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
-----------------------------------------------------------------------
--               GtkAda - Ada95 binding for Gtk+/Gnome               --
--                                                                   --
--                Copyright (C) 2006 AdaCore                         --
--                                                                   --
-- This library is free software; you can redistribute it and/or     --
-- modify it under the terms of the GNU General Public               --
-- License as published by the Free Software Foundation; either      --
-- version 2 of the License, or (at your option) any later version.  --
--                                                                   --
-- This library is distributed in the hope that it will be useful,   --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of    --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --
-- General Public License for more details.                          --
--                                                                   --
-- You should have received a copy of the GNU General Public         --
-- License along with this library; if not, write to the             --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --
-- Boston, MA 02111-1307, USA.                                       --
--                                                                   --
-----------------------------------------------------------------------

--  <description>
--  This package defines a special kind of menu, that can be inserted in a
--  toolbar. This is not something used very often, as in general a toolbar
--  provides a quick access to features that are already accessible in the
--  menu bar itself.
--  In practice, it is used internally by gtk+ itself to implement the
--  overflow menu in the toolbar.
--  </description>
--  <c_version>2.8.17</c_version>
--  <group>Menus and Toolbars</group>

with Glib.Properties;
with Gtk.Menu;
with Gtk.Tool_Button;
with Gtk.Tooltips;
with Gtk.Widget;

package Gtk.Menu_Tool_Button is

   type Gtk_Menu_Tool_Button_Record is
     new Gtk.Tool_Button.Gtk_Tool_Button_Record with null record;
   type Gtk_Menu_Tool_Button is access all Gtk_Menu_Tool_Button_Record'Class;

   procedure Gtk_New
     (Menu        : out Gtk_Menu_Tool_Button;
      Icon_Widget : Gtk.Widget.Gtk_Widget := null;
      Label       : String := "");
   procedure Initialize
     (Menu        : access Gtk_Menu_Tool_Button_Record'Class;
      Icon_Widget : Gtk.Widget.Gtk_Widget := null;
      Label       : String := "");
   --  Create a new menu by specifying explicitly the text that should appear
   --  on its button. When the button is clicked on, the menu is displayed.

   procedure Gtk_New_From_Stock
     (Menu     : out Gtk_Menu_Tool_Button;
      Stock_Id : String);
   procedure Initialize_From_Stock
     (Menu     : access Gtk_Menu_Tool_Button_Record'Class;
      Stock_Id : String);
   --  Create a new menu. The label and icon of its button are read from
   --  stock items (see gtk-stock.ads)

   function Get_Type return GType;
   --  Return the internal type used for this class of widgets

   procedure Set_Menu
     (Button : access Gtk_Menu_Tool_Button_Record;
      Menu   : access Gtk.Menu.Gtk_Menu_Record'Class);
   function Get_Menu
     (Button : access Gtk_Menu_Tool_Button_Record)
      return Gtk.Menu.Gtk_Menu;
   --  Set or Get the menu that it displayed when the button is clicked on

   procedure Set_Arrow_Tooltip
     (Button      : access Gtk_Menu_Tool_Button_Record;
      Tooltips    : access Gtk.Tooltips.Gtk_Tooltips_Record'Class;
      Tip_Text    : String;
      Tip_Private : String := "");
   --  Set the tooltip set on the arrow button that will display the menu when
   --  clicked on.

   -------------
   -- Signals --
   -------------

   --  <signals>
   --  The following new signals are defined for this widget:
   --
   --  - "show-menu"
   --    procedure Handler (Menu : access Gtk_Menu_Tool_Button_Record'Class);
   --    Emitted when the menu is being displayed
   --
   --  </signals>

   Signal_Show_Menu : constant String := "show-menu";

   ----------------
   -- Properties --
   ----------------

   --  <properties>
   --  The following properties are defined for this widget. See
   --  Glib.Properties for more information on properties.
   --
   --  Name: Menu_Property
   --  Type: Object
   --  See : Set_Menu / Get_Menu
   --
   --  </properties>

   Menu_Property : constant Glib.Properties.Property_Object;

private
   Menu_Property : constant Glib.Properties.Property_Object :=
     Glib.Properties.Build ("menu");
   pragma Import (C, Get_Type, "gtk_menu_tool_button_get_type");

end Gtk.Menu_Tool_Button;