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