NAME

UI::Various::Radio - general radio button widget of UI::Various

SYNOPSIS

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();

ABSTRACT

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.

DESCRIPTION

Besides the common attributes inherited from UI::Various::widget the Radio widget knows only two additional attributes:

Note that the possible values for the variable are 0 or 1, which will be changed according Perl's standard true/false conversions.

Attributes

buttons [rw, fixed]

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)

var [rw, recommended]

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.

METHODS

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:

new - constructor

see UI::Various::core::construct

SEE ALSO

UI::Various

LICENSE

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.

AUTHOR

Thomas Dorner <dorner (at) cpan (dot) org>