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-2007 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. --  This widget provides a special kind of menu item that represents a 
  27. --  radio button. Such a button can be checked or unchecked by the user, but 
  28. --  only one button in a group can be selected at any given time, as opposed to 
  29. --  a toggle menu item. 
  30. --  </description> 
  31. --  <c_version>2.8.17</c_version> 
  32. --  <group>Menus and Toolbars</group> 
  33.  
  34. with Glib.Properties; 
  35. with Gtk.Check_Menu_Item; 
  36. with Gtk.Widget; use Gtk.Widget; 
  37.  
  38. package Gtk.Radio_Menu_Item is 
  39.  
  40.    type Gtk_Radio_Menu_Item_Record is new 
  41.      Gtk.Check_Menu_Item.Gtk_Check_Menu_Item_Record with private; 
  42.    type Gtk_Radio_Menu_Item is access all Gtk_Radio_Menu_Item_Record'Class; 
  43.  
  44.    procedure Gtk_New 
  45.      (Radio_Menu_Item : out Gtk_Radio_Menu_Item; 
  46.       Group           : Widget_SList.GSlist; 
  47.       Label           : UTF8_String := ""); 
  48.    procedure Initialize 
  49.      (Radio_Menu_Item : access Gtk_Radio_Menu_Item_Record'Class; 
  50.       Group           : Widget_SList.GSlist; 
  51.       Label           : UTF8_String := ""); 
  52.    --  Creates or initializes a menu item 
  53.  
  54.    procedure Gtk_New_With_Mnemonic 
  55.      (Radio_Menu_Item : out Gtk_Radio_Menu_Item; 
  56.       Group           : Widget_SList.GSlist; 
  57.       Label           : UTF8_String); 
  58.    procedure Initialize_With_Mnemonic 
  59.      (Radio_Menu_Item : access Gtk_Radio_Menu_Item_Record'Class; 
  60.       Group           : Widget_SList.GSlist; 
  61.       Label           : UTF8_String); 
  62.    --  Creates or initializes a menu item. 
  63.    --  The first underscore sign in Label will be used as a key shortcut to 
  64.    --  this item when the menu is displayed. For instance, if you use "_Open", 
  65.    --  then pressing alt-o when the menu is open will select the menu item 
  66.  
  67.    procedure Gtk_New_From_Widget 
  68.      (Radio_Menu_Item : out Gtk_Radio_Menu_Item; 
  69.       Group           : access Gtk_Radio_Menu_Item_Record'Class); 
  70.    procedure Initialize_From_Widget 
  71.      (Radio_Menu_Item : access Gtk_Radio_Menu_Item_Record'Class; 
  72.       Group           : access Gtk_Radio_Menu_Item_Record'Class); 
  73.    --  Creates or initializes a menu item. It initially belongs to the same 
  74.    --  group as Group 
  75.  
  76.    procedure Gtk_New_With_Label_From_Widget 
  77.      (Radio_Menu_Item : out Gtk_Radio_Menu_Item; 
  78.       Group           : access Gtk_Radio_Menu_Item_Record'Class; 
  79.       Label           : String); 
  80.    procedure Initialize_With_Label_From_Widget 
  81.      (Radio_Menu_Item : access Gtk_Radio_Menu_Item_Record'Class; 
  82.       Group           : access Gtk_Radio_Menu_Item_Record'Class; 
  83.       Label           : String); 
  84.    --  Creates or initializes a menu item. It initially belongs to the same 
  85.    --  group as Group. 
  86.  
  87.    procedure Gtk_New_With_Mnemonic_From_Widget 
  88.      (Radio_Menu_Item : out Gtk_Radio_Menu_Item; 
  89.       Group           : access Gtk_Radio_Menu_Item_Record'Class; 
  90.       Label           : String); 
  91.    procedure Initialize_With_Mnemonic_From_Widget 
  92.      (Radio_Menu_Item : access Gtk_Radio_Menu_Item_Record'Class; 
  93.       Group           : access Gtk_Radio_Menu_Item_Record'Class; 
  94.       Label           : String); 
  95.    --  Same as Gtk_New_With_Mnemonic, except the group is given by a widget 
  96.  
  97.    function Get_Type return Gtk.Gtk_Type; 
  98.    --  Return the internal value associated with a Gtk_Radio_Menu_Item. 
  99.  
  100.    procedure Set_Group 
  101.      (Radio_Menu_Item : access Gtk_Radio_Menu_Item_Record; 
  102.       Group           : Widget_SList.GSlist); 
  103.    function Get_Group 
  104.      (Radio_Menu_Item : access Gtk_Radio_Menu_Item_Record) 
  105.       return Widget_SList.GSlist; 
  106.    --  Set or Get to which the menu item belongs. Only one menu item in this 
  107.    --  group can be selected at any given time 
  108.  
  109.    function Selected_Button (In_Group : Widget_SList.GSlist) return Natural; 
  110.    --  Return the button number of the selected button in the group. 
  111.    --  Note: This function is not part of Gtk+ itself, but is provided as a 
  112.    --  convenient function 
  113.  
  114.    ----------------- 
  115.    -- Obsolescent -- 
  116.    ----------------- 
  117.    --  All subprograms below are now obsolescent in gtk+. They might be removed 
  118.    --  from future versions of gtk+ (and therefore GtkAda). 
  119.    --  To find out whether your code uses any of these, we recommend compiling 
  120.    --  with the -gnatwj switch 
  121.    --  <doc_ignore> 
  122.  
  123.    function Group 
  124.      (Radio_Menu_Item : access Gtk_Radio_Menu_Item_Record) 
  125.       return Widget_SList.GSlist renames Get_Group; 
  126.    --  pragma Obsolescent; 
  127.    --  This function is deprecated. Get_Group should be used instead. 
  128.  
  129.    --  </doc_ignore> 
  130.  
  131.    ------------- 
  132.    -- Signals -- 
  133.    ------------- 
  134.  
  135.    --  <signals> 
  136.    --  The following new signals are defined for this widget: 
  137.    -- 
  138.    --  - "group-changed" 
  139.    --    procedure Handler (Item : access Gtk_Radio_Menu_Item_Record'Class); 
  140.    --    Emitted when the group of Item has been changed. 
  141.    -- 
  142.    --  </signals> 
  143.  
  144.    Signal_Group_Changed : constant Glib.Signal_Name := "group-changed"; 
  145.  
  146.    ---------------- 
  147.    -- Properties -- 
  148.    ---------------- 
  149.  
  150.    --  <properties> 
  151.    --  The following properties are defined for this widget. See 
  152.    --  Glib.Properties for more information on properties. 
  153.    -- 
  154.    --  Name:  Group_Property 
  155.    --  Type:  Object 
  156.    --  Descr: The radio menu item whose group this widget belongs to. 
  157.    -- 
  158.    --  </properties> 
  159.  
  160.    Group_Property : constant Glib.Properties.Property_Object; 
  161.  
  162. private 
  163.    type Gtk_Radio_Menu_Item_Record is new 
  164.      Gtk.Check_Menu_Item.Gtk_Check_Menu_Item_Record with null record; 
  165.  
  166.    Group_Property : constant Glib.Properties.Property_Object := 
  167.      Glib.Properties.Build ("group"); 
  168.  
  169.    pragma Import (C, Get_Type, "gtk_radio_menu_item_get_type"); 
  170. end Gtk.Radio_Menu_Item;