Tickit::Widget::RadioButton - a widget allowing a selection from multiple options
Tickit::Widget::RadioButton
use Tickit; use Tickit::Widget::RadioButton; use Tickit::Widget::VBox; my $group = Tickit::Widget::RadioButton::Group->new; my $vbox = Tickit::Widget::VBox->new; $vbox->add( Tickit::Widget::RadioButton->new( caption => "Radio button $_", group => $group, ) ) for 1 .. 5; Tickit->new( root => $vbox )->run;
This class provides a widget which allows a selection of one value from a group of related options. It provides a clickable area and a visual indication of which button in the group is the one currently active. Selecting a new button within a group will unselect the previously-selected one.
This widget is part of an experiment in evolving the design of the Tickit::Style widget integration code, and such is subject to change of details.
The default style pen is used as the widget pen. The following style pen prefixes are also used:
The pen used to render the tick marker
The following style keys are used:
The text used to indicate the active button
Number of columns of spacing between the tick mark and the caption text
The following style tags are used:
Set when this button is the active one of the group.
Constructs a new Tickit::Widget::RadioButton object.
Takes the following named argmuents
The label text to display alongside this button.
Optional. If supplied, the group that the button should belong to. If not supplied, a new group will be constructed that can be accessed using the group accessor.
group
Returns the Tickit::Widget::RadioButton::Group this button belongs to.
Tickit::Widget::RadioButton::Group
Returns or sets the label text of the button.
Sets this button as the active member of the group, deactivating the previous one.
Returns true if this button is the active button of the group.
Every Tickit::Widget::RadioButton belongs to a group. Only one button can be active in a group at any one time. The group accessor returns the group the button is a member of. The following methods are available on it.
A group can be explicitly created to pass to a button's constructor, or one will be implicitly created for a button if none is passed.
Returns a new group.
Returns the button which is currently active in the group
Paul Evans <leonerd@leonerd.org.uk>
To install Tickit::Widgets, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tickit::Widgets
CPAN shell
perl -MCPAN -e shell install Tickit::Widgets
For more information on module installation, please visit the detailed CPAN module installation guide.