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