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. --  A Gtk_Toggle_Action corresponds roughly to a Gtk_Check_Menu_Item. It has an 
  26. --  "active" state specifying whether the action has been checked or not. 
  27. --  </description> 
  28. --  <c_version>2.8.17</c_version> 
  29. --  <group>Action-based menus</group> 
  30. --  <see>Gtk.Action</see> 
  31.  
  32. with Glib.Properties; 
  33. with Gtk.Action; 
  34.  
  35. package Gtk.Toggle_Action is 
  36.  
  37.    type Gtk_Toggle_Action_Record is new Gtk.Action.Gtk_Action_Record with 
  38.      null record; 
  39.    type Gtk_Toggle_Action is access all Gtk_Toggle_Action_Record'Class; 
  40.  
  41.    procedure Gtk_New 
  42.      (Action   : out Gtk_Toggle_Action; 
  43.       Name     : String; 
  44.       Label    : String := ""; 
  45.       Tooltip  : String := ""; 
  46.       Stock_Id : String := ""); 
  47.    procedure Initialize 
  48.      (Action   : access Gtk_Toggle_Action_Record'Class; 
  49.       Name     : String; 
  50.       Label    : String := ""; 
  51.       Tooltip  : String := ""; 
  52.       Stock_Id : String := ""); 
  53.    --  Creates a new Gtk_Toggle_Action object. To add the action to 
  54.    --  a Gtk_Action_Group and set the accelerator for the action, 
  55.    --  call Gtk.Action_Group.Add_Action_With_Accel. 
  56.  
  57.    function Get_Type return GType; 
  58.    --  Return the internal type associated with Gtk_Toggle_Action. 
  59.  
  60.    procedure Set_Active 
  61.      (Action : access Gtk_Toggle_Action_Record; Is_Active : Boolean); 
  62.    function Get_Active 
  63.      (Action : access Gtk_Toggle_Action_Record) return Boolean; 
  64.    --  Returns the checked state of the toggle action. 
  65.  
  66.    procedure Set_Draw_As_Radio 
  67.      (Action : access Gtk_Toggle_Action_Record; Draw_As_Radio : Boolean); 
  68.    function Get_Draw_As_Radio 
  69.      (Action : access Gtk_Toggle_Action_Record) return Boolean; 
  70.    --  Returns whether the action should have proxies like a radio action. This 
  71.    --  changes the display of widgets associated with that action. 
  72.  
  73.    ---------------- 
  74.    -- Properties -- 
  75.    ---------------- 
  76.  
  77.    --  <properties> 
  78.    --  The following properties are defined for this widget. See 
  79.    --  Glib.Properties for more information on properties. 
  80.    -- 
  81.    --  Name:  Draw_As_Radio_Property 
  82.    --  Type:  Boolean 
  83.    --  Descr: Whether the proxies for this action look like radio action 
  84.    --         proxies 
  85.    -- 
  86.    --  </properties> 
  87.  
  88.    Draw_As_Radio_Property : constant Glib.Properties.Property_Boolean; 
  89.  
  90.    ------------- 
  91.    -- Signals -- 
  92.    ------------- 
  93.  
  94.    --  <signals> 
  95.    --  The following new signals are defined for this widget: 
  96.    -- 
  97.    --  - "toggled" 
  98.    --    procedure Handler (Toggled : access Gtk_Toggle_Action_Record'Class); 
  99.    --    Called when the state of the action is toggled. 
  100.    -- 
  101.    --  </signals> 
  102.  
  103.    Signal_Toggled : constant Glib.Signal_Name := "toggled"; 
  104.  
  105.    procedure Toggled (Action : access Gtk_Toggle_Action_Record); 
  106.    --  Emits the "toggled" signal on the toggle action. 
  107.  
  108. private 
  109.    Draw_As_Radio_Property : constant Glib.Properties.Property_Boolean := 
  110.      Glib.Properties.Build ("draw-as-radio"); 
  111.  
  112.    pragma Import (C, Get_Type, "gtk_toggle_action_get_type"); 
  113. end Gtk.Toggle_Action;