1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2013, AdaCore                   -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  <description> 
  31. --  A Gtk_Check_Button places a discrete Gtk_Toggle_Button next to a widget, 
  32. --  (usually a Gtk_Label). 
  33. -- 
  34. --  </description> 
  35. --  <screenshot>gtk-check_button</screenshot> 
  36. --  <group>Buttons and Toggles</group> 
  37. --  <testgtk>create_check_buttons.adb</testgtk> 
  38.  
  39. pragma Warnings (Off, "*is already use-visible*"); 
  40. with Glib;              use Glib; 
  41. with Glib.Types;        use Glib.Types; 
  42. with Gtk.Action;        use Gtk.Action; 
  43. with Gtk.Activatable;   use Gtk.Activatable; 
  44. with Gtk.Buildable;     use Gtk.Buildable; 
  45. with Gtk.Toggle_Button; use Gtk.Toggle_Button; 
  46. with Gtk.Widget;        use Gtk.Widget; 
  47.  
  48. package Gtk.Check_Button is 
  49.  
  50.    type Gtk_Check_Button_Record is new Gtk_Toggle_Button_Record with null record; 
  51.    type Gtk_Check_Button is access all Gtk_Check_Button_Record'Class; 
  52.  
  53.    ------------------ 
  54.    -- Constructors -- 
  55.    ------------------ 
  56.  
  57.    procedure Gtk_New 
  58.       (Check_Button : out Gtk_Check_Button; 
  59.        Label        : UTF8_String := ""); 
  60.    procedure Initialize 
  61.       (Check_Button : access Gtk_Check_Button_Record'Class; 
  62.        Label        : UTF8_String := ""); 
  63.    --  Create a check button. if Label is null, then no widget is associated 
  64.    --  with the button, and any widget can be added to the button (with 
  65.    --  Gtk.Container.Add). 
  66.  
  67.    procedure Gtk_New_With_Mnemonic 
  68.       (Check_Button : out Gtk_Check_Button; 
  69.        Label        : UTF8_String); 
  70.    procedure Initialize_With_Mnemonic 
  71.       (Check_Button : access Gtk_Check_Button_Record'Class; 
  72.        Label        : UTF8_String); 
  73.    --  Creates a new Gtk.Check_Button.Gtk_Check_Button containing a label. The 
  74.    --  label will be created using Gtk.Label.Gtk_New_With_Mnemonic, so 
  75.    --  underscores in Label indicate the mnemonic for the check button. 
  76.    --  "label": The text of the button, with an underscore in front of the 
  77.    --  mnemonic character 
  78.  
  79.    function Get_Type return Glib.GType; 
  80.    pragma Import (C, Get_Type, "gtk_check_button_get_type"); 
  81.  
  82.    --------------------- 
  83.    -- Interfaces_Impl -- 
  84.    --------------------- 
  85.  
  86.    procedure Do_Set_Related_Action 
  87.       (Self   : access Gtk_Check_Button_Record; 
  88.        Action : access Gtk.Action.Gtk_Action_Record'Class); 
  89.  
  90.    function Get_Related_Action 
  91.       (Self : access Gtk_Check_Button_Record) return Gtk.Action.Gtk_Action; 
  92.    procedure Set_Related_Action 
  93.       (Self   : access Gtk_Check_Button_Record; 
  94.        Action : access Gtk.Action.Gtk_Action_Record'Class); 
  95.  
  96.    function Get_Use_Action_Appearance 
  97.       (Self : access Gtk_Check_Button_Record) return Boolean; 
  98.    procedure Set_Use_Action_Appearance 
  99.       (Self           : access Gtk_Check_Button_Record; 
  100.        Use_Appearance : Boolean); 
  101.  
  102.    procedure Sync_Action_Properties 
  103.       (Self   : access Gtk_Check_Button_Record; 
  104.        Action : access Gtk.Action.Gtk_Action_Record'Class); 
  105.  
  106.    ---------------- 
  107.    -- Interfaces -- 
  108.    ---------------- 
  109.    --  This class implements several interfaces. See Glib.Types 
  110.    -- 
  111.    --  - "Activatable" 
  112.    -- 
  113.    --  - "Buildable" 
  114.  
  115.    package Implements_Activatable is new Glib.Types.Implements 
  116.      (Gtk.Activatable.Gtk_Activatable, Gtk_Check_Button_Record, Gtk_Check_Button); 
  117.    function "+" 
  118.      (Widget : access Gtk_Check_Button_Record'Class) 
  119.    return Gtk.Activatable.Gtk_Activatable 
  120.    renames Implements_Activatable.To_Interface; 
  121.    function "-" 
  122.      (Interf : Gtk.Activatable.Gtk_Activatable) 
  123.    return Gtk_Check_Button 
  124.    renames Implements_Activatable.To_Object; 
  125.  
  126.    package Implements_Buildable is new Glib.Types.Implements 
  127.      (Gtk.Buildable.Gtk_Buildable, Gtk_Check_Button_Record, Gtk_Check_Button); 
  128.    function "+" 
  129.      (Widget : access Gtk_Check_Button_Record'Class) 
  130.    return Gtk.Buildable.Gtk_Buildable 
  131.    renames Implements_Buildable.To_Interface; 
  132.    function "-" 
  133.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  134.    return Gtk_Check_Button 
  135.    renames Implements_Buildable.To_Object; 
  136.  
  137. end Gtk.Check_Button;