1Gtk2::RadioButton(3) User Contributed Perl Documentation Gtk2::RadioButton(3)
2
3
4
6 Gtk2::RadioButton
7
9 # first group
10 $foo1 = Gtk2::RadioButton->new (undef, 'Foo One');
11 $foo2 = Gtk2::RadioButton->new ($foo1, 'Foo Two');
12 $foo3 = Gtk2::RadioButton->new ($foo2, 'Foo Three');
13
14 # second group, using the group reference
15 $bar1 = Gtk2::RadioButton->new (undef, 'Bar One');
16 $group = $bar1->get_group;
17 $bar2 = Gtk2::RadioButton->new ($group, 'Bar Two');
18 $bar3 = Gtk2::RadioButton->new ($group, 'Bar Three');
19
20 # move bar3 from the bar group to the foo group.
21 $bar->set_group ($foo->get_group);
22
23 # iterate over the widgets in the group
24 $group = $foo1->get_group;
25 foreach my $r (@$group) {
26 $r->set_sensitive ($whatever);
27 }
28
30 A single radio button performs the same basic function as a
31 Gtk2::CheckButton, as its position in the object hierarchy reflects.
32 It is only when multiple radio buttons are grouped together that they
33 become a different user interface component in their own right.
34
35 Every radio button is a member of some group of radio buttons. When
36 one is selected, all other radio buttons in the same group are dese‐
37 lected. A Gtk2::RadioButton is one way of giving the user a choice
38 from many options; Gtk2::OptionMenu and Gtk2::ComboBox (added in gtk+
39 2.4) are alternatives.
40
41 Each constructor can take either a group or widget from that group
42 where the group is wanted; this is an enhancement over the C API. Nev‐
43 ertheless, the _from_widget forms are provided for completeness.
44
46 Glib::Object
47 +----Glib::InitiallyUnowned
48 +----Gtk2::Object
49 +----Gtk2::Widget
50 +----Gtk2::Container
51 +----Gtk2::Bin
52 +----Gtk2::Button
53 +----Gtk2::ToggleButton
54 +----Gtk2::CheckButton
55 +----Gtk2::RadioButton
56
58 Glib::Object::_Unregistered::AtkImplementorIface
59
61 widget = Gtk2::RadioButton->new ($member_or_listref=undef,
62 $label=undef)
63
64 * $member_or_listref (scalar) reference to radiobutton group or a
65 Gtk2::RadioButton belonging to that group.
66 * $label (string)
67
68 Create a radio button. If $label is provided, it will be inter‐
69 preted as a mnemonic. If $member_or_listref is undef, the radio
70 button will be created in a new group.
71
72 widget = Gtk2::RadioButton->new_from_widget ($group, $label=undef)
73
74 * $group (Gtk2::RadioButton or undef)
75 * $label (string)
76
77 widget = Gtk2::RadioButton->new_with_label ($member_or_listref=undef,
78 $label=undef)
79
80 * $member_or_listref (scalar) reference to radiobutton group or a
81 Gtk2::RadioButton belonging to that group.
82 * $label (string)
83
84 Create a radio button with a plain text label, which will not be
85 interpreted as a mnemonic.
86
87 widget = Gtk2::RadioButton->new_with_label_from_widget ($group,
88 $label=undef)
89
90 * $group (Gtk2::RadioButton or undef)
91 * $label (string)
92
93 widget = Gtk2::RadioButton->new_with_mnemonic ($mem‐
94 ber_or_listref=undef, $label=undef)
95
96 * $member_or_listref (scalar) reference to radiobutton group or a
97 Gtk2::RadioButton belonging to that group.
98 * $label (string)
99
100 Create a radio button with a mnemonic; this is an alias for "new".
101
102 widget = Gtk2::RadioButton->new_with_mnemonic_from_widget ($group,
103 $label=undef)
104
105 * $group (Gtk2::RadioButton or undef)
106 * $label (string)
107
108 $group = $radio_button->get_group
109
110 Return a reference to the radio group to which $radio_button
111 belongs. The group is a reference to an array of widget refer‐
112 ences; the array is not magical, that is, it will not be updated
113 automatically if the group changes; call "get_group" each time you
114 want to use the group.
115
116 $radio_button->set_group ($member_or_listref)
117
118 * $member_or_listref (scalar) reference to the group or a
119 Gtk2::RadioButton belonging to that group.
120
121 Assign $radio_button to a new group.
122
124 'group' (Gtk2::RadioButton : writable / private)
125 The radio button whose group this widget belongs to.
126
128 group-changed (Gtk2::RadioButton)
129
131 Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
132 Gtk2::Container, Gtk2::Bin, Gtk2::Button, Gtk2::ToggleButton,
133 Gtk2::CheckButton
134
136 Copyright (C) 2003-2007 by the gtk2-perl team.
137
138 This software is licensed under the LGPL. See Gtk2 for a full notice.
139
140
141
142perl v5.8.8 2007-03-18 Gtk2::RadioButton(3)