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-2011, 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. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  <description> 
  26. --  A Gtk_Check_Button places a discrete Gtk_Toggle_Button next to a widget, 
  27. --  (usually a Gtk_Label). 
  28. -- 
  29. --  </description> 
  30. --  <screenshot>gtk-check_button</screenshot> 
  31. --  <group>Buttons and Toggles</group> 
  32. --  <testgtk>create_check_buttons.adb</testgtk> 
  33.  
  34. pragma Warnings (Off, "*is already use-visible*"); 
  35. with Glib;              use Glib; 
  36. with Glib.Types;        use Glib.Types; 
  37. with Gtk.Action;        use Gtk.Action; 
  38. with Gtk.Activatable;   use Gtk.Activatable; 
  39. with Gtk.Buildable;     use Gtk.Buildable; 
  40. with Gtk.Toggle_Button; use Gtk.Toggle_Button; 
  41. with Gtk.Widget;        use Gtk.Widget; 
  42.  
  43. package Gtk.Check_Button is 
  44.  
  45.    type Gtk_Check_Button_Record is new Gtk_Toggle_Button_Record with null record; 
  46.    type Gtk_Check_Button is access all Gtk_Check_Button_Record'Class; 
  47.  
  48.    ------------------ 
  49.    -- Constructors -- 
  50.    ------------------ 
  51.  
  52.    procedure Gtk_New 
  53.       (Check_Button : out Gtk_Check_Button; 
  54.        Label        : UTF8_String := ""); 
  55.    procedure Initialize 
  56.       (Check_Button : access Gtk_Check_Button_Record'Class; 
  57.        Label        : UTF8_String := ""); 
  58.    --  Create a check button. if Label is null, then no widget is associated 
  59.    --  with the button, and any widget can be added to the button (with 
  60.    --  Gtk.Container.Add). 
  61.  
  62.    procedure Gtk_New_With_Mnemonic 
  63.       (Check_Button : out Gtk_Check_Button; 
  64.        Label        : UTF8_String); 
  65.    procedure Initialize_With_Mnemonic 
  66.       (Check_Button : access Gtk_Check_Button_Record'Class; 
  67.        Label        : UTF8_String); 
  68.    --  Creates a new Gtk.Check_Button.Gtk_Check_Button containing a label. The 
  69.    --  label will be created using Gtk.Label.Gtk_New_With_Mnemonic, so 
  70.    --  underscores in Label indicate the mnemonic for the check button. 
  71.    --  "label": The text of the button, with an underscore in front of the 
  72.    --  mnemonic character 
  73.  
  74.    function Get_Type return Glib.GType; 
  75.    pragma Import (C, Get_Type, "gtk_check_button_get_type"); 
  76.  
  77.    --------------------- 
  78.    -- Interfaces_Impl -- 
  79.    --------------------- 
  80.  
  81.    procedure Do_Set_Related_Action 
  82.       (Self   : access Gtk_Check_Button_Record; 
  83.        Action : access Gtk.Action.Gtk_Action_Record'Class); 
  84.  
  85.    function Get_Related_Action 
  86.       (Self : access Gtk_Check_Button_Record) return Gtk.Action.Gtk_Action; 
  87.    procedure Set_Related_Action 
  88.       (Self   : access Gtk_Check_Button_Record; 
  89.        Action : access Gtk.Action.Gtk_Action_Record'Class); 
  90.  
  91.    function Get_Use_Action_Appearance 
  92.       (Self : access Gtk_Check_Button_Record) return Boolean; 
  93.    procedure Set_Use_Action_Appearance 
  94.       (Self           : access Gtk_Check_Button_Record; 
  95.        Use_Appearance : Boolean); 
  96.  
  97.    procedure Sync_Action_Properties 
  98.       (Self   : access Gtk_Check_Button_Record; 
  99.        Action : access Gtk.Action.Gtk_Action_Record'Class); 
  100.  
  101.    ---------------- 
  102.    -- Interfaces -- 
  103.    ---------------- 
  104.    --  This class implements several interfaces. See Glib.Types 
  105.    -- 
  106.    --  - "Activatable" 
  107.    -- 
  108.    --  - "Buildable" 
  109.  
  110.    package Implements_Activatable is new Glib.Types.Implements 
  111.      (Gtk.Activatable.Gtk_Activatable, Gtk_Check_Button_Record, Gtk_Check_Button); 
  112.    function "+" 
  113.      (Widget : access Gtk_Check_Button_Record'Class) 
  114.    return Gtk.Activatable.Gtk_Activatable 
  115.    renames Implements_Activatable.To_Interface; 
  116.    function "-" 
  117.      (Interf : Gtk.Activatable.Gtk_Activatable) 
  118.    return Gtk_Check_Button 
  119.    renames Implements_Activatable.To_Object; 
  120.  
  121.    package Implements_Buildable is new Glib.Types.Implements 
  122.      (Gtk.Buildable.Gtk_Buildable, Gtk_Check_Button_Record, Gtk_Check_Button); 
  123.    function "+" 
  124.      (Widget : access Gtk_Check_Button_Record'Class) 
  125.    return Gtk.Buildable.Gtk_Buildable 
  126.    renames Implements_Buildable.To_Interface; 
  127.    function "-" 
  128.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  129.    return Gtk_Check_Button 
  130.    renames Implements_Buildable.To_Object; 
  131.  
  132. end Gtk.Check_Button;