1Gtk2::RadioButton(3)  User Contributed Perl Documentation Gtk2::RadioButton(3)
2
3
4

NAME

6       Gtk2::RadioButton
7

SYNOPSIS

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

DESCRIPTION

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
37       deselected.  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.
43       Nevertheless, the _from_widget forms are provided for completeness.
44

HIERARCHY

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

INTERFACES

58         Glib::Object::_Unregistered::AtkImplementorIface
59         Gtk2::Buildable
60         Glib::Object::_Unregistered::GtkActivatable
61

METHODS

63   widget = Gtk2::RadioButton->new ($member_or_listref=undef, $label=undef)
64           ·   $member_or_listref (scalar) reference to radiobutton group or a
65               Gtk2::RadioButton belonging to that group.
66
67           ·   $label (string)
68
69           Create a radio button.  If $label is provided, it will be
70           interpreted as a mnemonic.  If $member_or_listref is undef, the
71           radio button will be created in a new group.
72
73   widget = Gtk2::RadioButton->new_from_widget ($group, $label=undef)
74           ·   $group (Gtk2::RadioButton or undef)
75
76           ·   $label (string)
77
78   widget = Gtk2::RadioButton->new_with_label ($member_or_listref=undef,
79       $label=undef)
80           ·   $member_or_listref (scalar) reference to radiobutton group or a
81               Gtk2::RadioButton belonging to that group.
82
83           ·   $label (string)
84
85           Create a radio button with a plain text label, which will not be
86           interpreted as a mnemonic.
87
88   widget = Gtk2::RadioButton->new_with_label_from_widget ($group,
89       $label=undef)
90           ·   $group (Gtk2::RadioButton or undef)
91
92           ·   $label (string)
93
94   widget = Gtk2::RadioButton->new_with_mnemonic ($member_or_listref=undef,
95       $label=undef)
96           ·   $member_or_listref (scalar) reference to radiobutton group or a
97               Gtk2::RadioButton belonging to that group.
98
99           ·   $label (string)
100
101           Create a radio button with a mnemonic; this is an alias for "new".
102
103   widget = Gtk2::RadioButton->new_with_mnemonic_from_widget ($group,
104       $label=undef)
105           ·   $group (Gtk2::RadioButton or undef)
106
107           ·   $label (string)
108
109   $group = $radio_button->get_group
110           Return a reference to the radio group to which $radio_button
111           belongs.  The group is a reference to an array of widget
112           references; the array is not magical, that is, it will not be
113           updated automatically if the group changes; call "get_group" each
114           time you want to use the group.
115
116   $radio_button->set_group ($member_or_listref)
117           ·   $member_or_listref (scalar) reference to the group or a
118               Gtk2::RadioButton belonging to that group.
119
120           Assign $radio_button to a new group.
121

PROPERTIES

123       'group' (Gtk2::RadioButton : writable / private)
124           The radio button whose group this widget belongs to.
125

SIGNALS

127       group-changed (Gtk2::RadioButton)
128

SEE ALSO

130       Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
131       Gtk2::Container, Gtk2::Bin, Gtk2::Button, Gtk2::ToggleButton,
132       Gtk2::CheckButton
133
135       Copyright (C) 2003-2008 by the gtk2-perl team.
136
137       This software is licensed under the LGPL.  See Gtk2 for a full notice.
138
139
140
141perl v5.12.0                      2010-05-02              Gtk2::RadioButton(3)
Impressum