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