UI::Various::Radio - general radio button widget of UI::Various
use UI::Various; my $main = UI::Various::main(); my $variable = 0; $main->window(... UI::Various::Radio->new(buttons => [1 => 'One', 2 => 'Two', 3 => 'Three']), ...); $main->mainloop();
This module defines the general radio button widget of an application using UI::Various. The radio buttons are vertically aligned.
Note that the limitation to the vertical orientation comes from Curses::UI::Radiobuttonbox.
Besides the common attributes inherited from UI::Various::widget the Radio widget knows only two additional attributes:
UI::Various::widget
Radio
Note that the possible values for the variable are 0 or 1, which will be changed according Perl's standard true/false conversions.
0
1
an ARRAY with pairs of key values and corresponding displayed texts of the radio buttons, e.g.:
[ 1 => 'red', 2 => 'green', 3 => 'blue' ]
(looks like a HASH, but is technically an ARRAY as its sequence is important)
a variable reference for the radio buttons
The variable will be set to one of the key values of buttons when it is selected. Note that if it's initial value is defined to something not being an existing key value of that ARRAY, it will be set to undef.
buttons
undef
Besides the accessors (attributes) described above and by UI::Various::widget and the methods inherited from UI::Various::widget only the constructor is provided by the Radio class itself:
see UI::Various::core::construct
UI::Various
Copyright (C) Thomas Dorner.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See LICENSE file for more details.
Thomas Dorner <dorner (at) cpan (dot) org>
To install UI::Various, copy and paste the appropriate command in to your terminal.
cpanm
cpanm UI::Various
CPAN shell
perl -MCPAN -e shell install UI::Various
For more information on module installation, please visit the detailed CPAN module installation guide.