1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2006-2007 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 the base class for all items that can be added into 
  31. --  a toolbar (see gtk-toolbar.ads). 
  32. --  See also Gtk.Tool_Button (gtk-tool_button.ads). 
  33. --  See also Gtk.Separator_Tool_Item (gtk-separator_tool_item). 
  34. --  </description> 
  35. --  <c_version>2.8.17</c_version> 
  36. --  <group>Menus and Toolbars</group> 
  37.  
  38. with Glib.Properties; 
  39. with Gtk.Tool_Button; 
  40.  
  41. package Gtk.Toggle_Tool_Button is 
  42.  
  43.    type Gtk_Toggle_Tool_Button_Record is 
  44.      new Gtk.Tool_Button.Gtk_Tool_Button_Record with null record; 
  45.    type Gtk_Toggle_Tool_Button is 
  46.      access all Gtk_Toggle_Tool_Button_Record'Class; 
  47.  
  48.    procedure Gtk_New    (Button : out Gtk_Toggle_Tool_Button); 
  49.    procedure Initialize (Button : access Gtk_Toggle_Tool_Button_Record'Class); 
  50.    --  Create or initialize a new toggle button 
  51.  
  52.    procedure Gtk_New_From_Stock 
  53.      (Button   : out Gtk_Toggle_Tool_Button; 
  54.       Stock_Id : String); 
  55.    procedure Initialize_From_Stock 
  56.      (Button   : access Gtk_Toggle_Tool_Button_Record'Class; 
  57.       Stock_Id : String); 
  58.    --  Create or initialize a new toggle button that contains a text and image 
  59.    --  from a stock item. 
  60.  
  61.    function Get_Type return GType; 
  62.    --  Internal type representing this class of widgets 
  63.  
  64.    procedure Set_Active 
  65.      (Button    : access Gtk_Toggle_Tool_Button_Record; 
  66.       Is_Active : Boolean); 
  67.    function Get_Active 
  68.      (Button : access Gtk_Toggle_Tool_Button_Record) 
  69.       return Boolean; 
  70.    --  Sets whether the button should be selected 
  71.  
  72.    ------------- 
  73.    -- Signals -- 
  74.    ------------- 
  75.  
  76.    --  <signals> 
  77.    --  The following new signals are defined for this widget: 
  78.    -- 
  79.    --  - "toggled" 
  80.    --    procedure Handler 
  81.    --      (Button     : access Gtk_Toggle_Tool_Button_Record'Class); 
  82.    --    Emitted whenever the toggle button changes state 
  83.    -- 
  84.    --  </signals> 
  85.  
  86.    Signal_Toggled : constant Glib.Signal_Name := "toggled"; 
  87.  
  88.    ---------------- 
  89.    -- Properties -- 
  90.    ---------------- 
  91.  
  92.    --  <properties> 
  93.    --  The following properties are defined for this widget. See 
  94.    --  Glib.Properties for more information on properties. 
  95.    -- 
  96.    --  Name: Active_Property 
  97.    --  Type: Boolean 
  98.    --  See : Set_Active / Get_Active 
  99.    -- 
  100.    --  </properties> 
  101.  
  102.    Active_Property : constant Glib.Properties.Property_Boolean; 
  103.  
  104. private 
  105.    Active_Property : constant Glib.Properties.Property_Boolean := 
  106.      Glib.Properties.Build ("active"); 
  107.  
  108.    pragma Import (C, Get_Type, "gtk_toggle_tool_button_get_type"); 
  109. end Gtk.Toggle_Tool_Button;