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