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-2006 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. --  </description> 
  29. --  <c_version>2.8.17</c_version> 
  30. --  <screenshot>gtk-check_button</screenshot> 
  31. --  <group>Buttons and Toggles</group> 
  32. --  <testgtk>create_check_buttons.adb</testgtk> 
  33.  
  34. with Glib.Properties; 
  35. with Gtk.Toggle_Button; 
  36.  
  37. package Gtk.Check_Button is 
  38.  
  39.    type Gtk_Check_Button_Record is new 
  40.      Toggle_Button.Gtk_Toggle_Button_Record with private; 
  41.    type Gtk_Check_Button is access all Gtk_Check_Button_Record'Class; 
  42.  
  43.    procedure Gtk_New 
  44.      (Check_Button : out Gtk_Check_Button; 
  45.       Label        : UTF8_String := ""); 
  46.    --  Create a check button. 
  47.    --  if Label is null, then no widget is associated with the button, and 
  48.    --  any widget can be added to the button (with Gtk.Container.Add). 
  49.  
  50.    procedure Gtk_New_With_Mnemonic 
  51.      (Check_Button : out Gtk_Check_Button; 
  52.       Label        : UTF8_String); 
  53.    --  Create a new check button containing a label. 
  54.    --  If characters in Label are preceded by an underscore, they are 
  55.    --  underlined indicating that they represent a keyboard accelerator called 
  56.    --  a mnemonic. 
  57.    --  Pressing Alt and that key activates the checkbutton. 
  58.    --  Label: The text of the button, with an underscore in front of the 
  59.    --         mnemonic character 
  60.  
  61.    procedure Initialize 
  62.      (Check_Button : access Gtk_Check_Button_Record'Class; 
  63.       Label        : UTF8_String := ""); 
  64.    --  Internal initialization function. 
  65.    --  See the section "Creating your own widgets" in the documentation. 
  66.  
  67.    procedure Initialize_With_Mnemonic 
  68.      (Check_Button : access Gtk_Check_Button_Record'Class; 
  69.       Label        : UTF8_String); 
  70.    --  Internal initialization function. 
  71.  
  72.    function Get_Type return Glib.GType; 
  73.    --  Return the internal value associated with a Gtk_Check_Button. 
  74.  
  75.    ---------------------- 
  76.    -- Style Properties -- 
  77.    ---------------------- 
  78.    --  The following properties can be changed through the gtk theme and 
  79.    --  configuration files, and retrieved through Gtk.Widget.Style_Get_Property 
  80.  
  81.    --  <style_properties> 
  82.    --  Name:  Indicator_Size_Property 
  83.    --  Type:  Int 
  84.    --  Descr: Size of check or radio indicator 
  85.    -- 
  86.    --  Name:  Indicator_Spacing_Property 
  87.    --  Type:  Int 
  88.    --  Descr: Spacing around check or radio indicator 
  89.    --  </style_properties> 
  90.  
  91.    Indicator_Size_Property    : constant Glib.Properties.Property_Int; 
  92.    Indicator_Spacing_Property : constant Glib.Properties.Property_Int; 
  93.  
  94. private 
  95.    type Gtk_Check_Button_Record is new 
  96.      Gtk.Toggle_Button.Gtk_Toggle_Button_Record with null record; 
  97.    pragma Import (C, Get_Type, "gtk_check_button_get_type"); 
  98.  
  99.    Indicator_Size_Property : constant Glib.Properties.Property_Int := 
  100.      Glib.Properties.Build ("indicator-size"); 
  101.    Indicator_Spacing_Property : constant Glib.Properties.Property_Int := 
  102.      Glib.Properties.Build ("indicator-spacing"); 
  103. end Gtk.Check_Button;