## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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-2013, 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.     -----------------------------------------------------------------------

30.     --  <description>

31.     --  A Gtk_Radio_Button is a simple button that has two states, like a

32.     --  Gtk_Toggle_Button. However, Gtk_Radio_Buttons can be grouped together to

33.     --  get a special behavior: only one button in the group can be active at any

34.     --  given time. Thus, when the user selects one of the buttons from the group,

35.     --  the button that was previously selected is disabled.

36.     --

37.     --  The radio buttons always belongs to a group, even if there is only one in

38.     --  this group.

39.     --

40.     --  </description>

41.     --  <screenshot>gtk-radio_button</screenshot>

42.     --  <group>Buttons and Toggles</group>

43.     --  <testgtk>create_radio_button.adb</testgtk>

45.     pragma Warnings (Off, "*is already use-visible*");

46.     with GlibTo API docTo specTo body;             use GlibTo API docTo specTo body;

47.     with Glib.PropertiesTo API docTo specTo body;  use Glib.PropertiesTo API docTo specTo body;

48.     with Glib.TypesTo API docTo specTo body;       use Glib.TypesTo API docTo specTo body;

49.     with Gtk.ActionTo API docTo specTo body;       use Gtk.ActionTo API docTo specTo body;

50.     with Gtk.ActivatableTo API docTo specTo body;  use Gtk.ActivatableTo API docTo specTo body;

51.     with Gtk.BuildableTo API docTo specTo body;    use Gtk.BuildableTo API docTo specTo body;

52.     with Gtk.Check_ButtonTo API docTo specTo body; use Gtk.Check_ButtonTo API docTo specTo body;

53.     with Gtk.WidgetTo API docTo specTo body;       use Gtk.WidgetTo API docTo specTo body;

55.     package Gtk.Radio_ButtonTo API docTo specTo body is

57.        type Gtk_Radio_Button_Record is new Gtk_Check_Button_RecordTo API docTo spec with null record;

58.        type Gtk_Radio_Button is access all Gtk_Radio_Button_RecordTo API docTo spec'Class;

60.        ------------------

61.        -- Constructors --

62.        ------------------

64.        procedure Gtk_NewTo API docTo body

65.           (Radio_Button : out Gtk_Radio_ButtonTo API docTo spec;

66.            GroupTo API docTo body        : Gtk.Widget.Widget_SList.GSlistTo API docTo specTo body := Widget_SList.Null_ListTo API docTo specTo body;

67.            Label        : UTF8_StringTo API docTo spec := "");

68.        procedure InitializeTo API docTo body

69.           (Radio_Button : access Gtk_Radio_Button_RecordTo API docTo spec'Class;

70.            GroupTo API docTo body        : Gtk.Widget.Widget_SList.GSlistTo API docTo specTo body := Widget_SList.Null_ListTo API docTo specTo body;

71.            Label        : UTF8_StringTo API docTo spec := "");

72.        --  Creates or initializes a new radio button, belonging to Group. If Label

73.        --  is left as the empty string, then the button will not have any child and

74.        --  you are free to put any thing you want in it, including a pixmap. To

75.        --  initialize the group (when creating the first button), leave Group to

76.        --  the Null_List. You can later get the new group that is created with a

77.        --  call to the Get_Group subprogram below.

78.        --  "group": an existing radio button group, or null if you are creating a

79.        --  new group.

80.        --  "label": the text label to display next to the radio button.

82.        procedure Gtk_NewTo API docTo body

83.           (Radio_Button : out Gtk_Radio_ButtonTo API docTo spec;

84.            Group        : Gtk_Radio_ButtonTo API docTo spec;

85.            Label        : UTF8_StringTo API docTo spec := "");

86.        procedure InitializeTo API docTo body

87.           (Radio_Button : access Gtk_Radio_Button_RecordTo API docTo spec'Class;

88.            Group        : Gtk_Radio_ButtonTo API docTo spec;

89.            Label        : UTF8_StringTo API docTo spec := "");

90.        --  Creates a new Gtk.Radio_Button.Gtk_Radio_Button with a text label,

91.        --  adding it to the same group as Radio_Group_Member.

92.        --  "Group": widget to get radio group from or null

93.        --  "label": a text string to display next to the radio button.

95.        procedure Gtk_New_With_MnemonicTo API docTo body

96.           (Radio_Button : out Gtk_Radio_ButtonTo API docTo spec;

97.            GroupTo API docTo body        : Gtk.Widget.Widget_SList.GSlistTo API docTo specTo body := Widget_SList.Null_ListTo API docTo specTo body;

98.            Label        : UTF8_StringTo API docTo spec);

99.        procedure Initialize_With_MnemonicTo API docTo body

100.           (Radio_Button : access Gtk_Radio_Button_RecordTo API docTo spec'Class;

101.            GroupTo API docTo body        : Gtk.Widget.Widget_SList.GSlistTo API docTo specTo body := Widget_SList.Null_ListTo API docTo specTo body;

102.            Label        : UTF8_StringTo API docTo spec);

103.        procedure Gtk_New_With_MnemonicTo API docTo body

104.           (Radio_Button : out Gtk_Radio_ButtonTo API docTo spec;

105.            Group        : Gtk_Radio_ButtonTo API docTo spec;

106.            Label        : UTF8_StringTo API docTo spec);

107.        procedure Initialize_With_MnemonicTo API docTo body

108.           (Radio_Button : access Gtk_Radio_Button_RecordTo API docTo spec'Class;

109.            Group        : Gtk_Radio_ButtonTo API docTo spec;

110.            Label        : UTF8_StringTo API docTo spec);

111.        --  Creates a new Gtk.Radio_Button.Gtk_Radio_Button containing a label. The

112.        --  label will be created using Gtk.Label.Gtk_New_With_Mnemonic, so

113.        --  underscores in Label indicate the mnemonic for the button.

114.        --  To initialize a new group (when creating the first button), you should

115.        --  pass it null or a button that has not been created with Gtk_New, as in

116.        --  the example below.

117.        --  "Group": widget to get radio group from or null

118.        --  "label": the text of the button, with an underscore in front of the

119.        --  mnemonic character

121.        function Get_TypeTo API docTo body return Glib.GTypeTo API docTo spec;

122.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_radio_button_get_type");

124.        -------------

125.        -- Methods --

126.        -------------

128.        function Get_GroupTo API docTo body

129.           (Radio_Button : access Gtk_Radio_Button_RecordTo API docTo spec)

130.            return Gtk.Widget.Widget_SList.GSlistTo API docTo specTo body;

131.        procedure Set_GroupTo API docTo body

132.           (Radio_Button : access Gtk_Radio_Button_RecordTo API docTo spec;

133.            GroupTo API docTo body        : Gtk.Widget.Widget_SList.GSlistTo API docTo specTo body);

134.        --  Sets a Gtk.Radio_Button.Gtk_Radio_Button's group. It should be noted

135.        --  that this does not change the layout of your interface in any way, so if

136.        --  you are changing the group, it is likely you will need to re-arrange the

137.        --  user interface to reflect these changes.

138.        --  "group": an existing radio button group, such as one returned from

139.        --  Gtk.Radio_Button.Get_Group.

141.        ---------------------

142.        -- Interfaces_Impl --

143.        ---------------------

145.        procedure Do_Set_Related_ActionTo API docTo body

146.           (Self   : access Gtk_Radio_Button_RecordTo API docTo spec;

147.            Action : access Gtk.Action.Gtk_Action_RecordTo API docTo specTo body'Class);

149.        function Get_Related_ActionTo API docTo body

150.           (Self : access Gtk_Radio_Button_RecordTo API docTo spec) return Gtk.Action.Gtk_ActionTo API docTo spec;

151.        procedure Set_Related_ActionTo API docTo body

152.           (Self   : access Gtk_Radio_Button_RecordTo API docTo spec;

153.            Action : access Gtk.Action.Gtk_Action_RecordTo API docTo specTo body'Class);

155.        function Get_Use_Action_AppearanceTo API docTo body

156.           (Self : access Gtk_Radio_Button_RecordTo API docTo spec) return Boolean;

157.        procedure Set_Use_Action_AppearanceTo API docTo body

158.           (Self           : access Gtk_Radio_Button_RecordTo API docTo spec;

159.            Use_Appearance : Boolean);

161.        procedure Sync_Action_PropertiesTo API docTo body

162.           (Self   : access Gtk_Radio_Button_RecordTo API docTo spec;

163.            Action : access Gtk.Action.Gtk_Action_RecordTo API docTo specTo body'Class);

165.        ----------------

166.        -- Interfaces --

167.        ----------------

168.        --  This class implements several interfaces. See Glib.Types

169.        --

170.        --  - "Activatable"

171.        --

172.        --  - "Buildable"

174.        package Implements_Activatable is new Glib.Types.ImplementsTo API docTo specTo body

175.          (Gtk.Activatable.Gtk_ActivatableTo API docTo spec, Gtk_Radio_Button_RecordTo API docTo spec, Gtk_Radio_ButtonTo API docTo spec);

176.        function "+"

177.          (Widget : access Gtk_Radio_Button_RecordTo API docTo spec'Class)

178.        return Gtk.Activatable.Gtk_ActivatableTo API docTo spec

179.        renames Implements_Activatable.To_InterfaceTo API docTo specTo body;

180.        function "-"

181.          (Interf : Gtk.Activatable.Gtk_ActivatableTo API docTo spec)

182.        return Gtk_Radio_ButtonTo API docTo spec

183.        renames Implements_Activatable.To_ObjectTo API docTo specTo body;

185.        package Implements_Buildable is new Glib.Types.ImplementsTo API docTo specTo body

186.          (Gtk.Buildable.Gtk_BuildableTo API docTo spec, Gtk_Radio_Button_RecordTo API docTo spec, Gtk_Radio_ButtonTo API docTo spec);

187.        function "+"

188.          (Widget : access Gtk_Radio_Button_RecordTo API docTo spec'Class)

189.        return Gtk.Buildable.Gtk_BuildableTo API docTo spec

190.        renames Implements_Buildable.To_InterfaceTo API docTo specTo body;

191.        function "-"

192.          (Interf : Gtk.Buildable.Gtk_BuildableTo API docTo spec)

193.        return Gtk_Radio_ButtonTo API docTo spec

194.        renames Implements_Buildable.To_ObjectTo API docTo specTo body;

196.        ----------------

197.        -- Properties --

198.        ----------------

199.        --  The following properties are defined for this widget. See

200.        --  Glib.Properties for more information on properties)

201.        --

202.        --  Name: Group_Property

203.        --  Type: Gtk_Radio_Button

204.        --  Flags: write

206.        Group_Property : constant Glib.Properties.Property_ObjectTo API docTo spec;

208.        -------------

209.        -- Signals --

210.        -------------

211.        --  The following new signals are defined for this widget:

212.        --

213.        --  "group-changed"

214.        --     procedure Handler (Self : access Gtk_Radio_Button_Record'Class);

215.        --  Emitted when the group of radio buttons that a radio button belongs to

216.        --  changes. This is emitted when a radio button switches from being alone

217.        --  to being part of a group of 2 or more buttons, or vice-versa, and when a

218.        --  button is moved from one group of 2 or more buttons to a different one,

219.        --  but not when the composition of the group that a button belongs to

220.        --  changes.

222.        Signal_Group_Changed : constant Glib.Signal_NameTo API docTo spec := "group-changed";

224.     private

225.        Group_PropertyTo API docTo spec : constant Glib.Properties.Property_ObjectTo API docTo spec :=

226.          Glib.Properties.BuildTo API docTo specTo body ("group");

227.     end Gtk.Radio_ButtonTo API docTo specTo body;