Tickit::Widget::Choice - a widget giving a choice from a list
Tickit::Widget::Choice
$choice = Tickit::Widget::Choice->new( %args )
Constructs a new Tickit::Widget::Choice object.
Takes the following named arguments
Optional. If supplied, should be an ARRAY reference containing two-element ARRAY references. Each will be added to the list of choices as if by a call to push_choice for each element in the array.
push_choice
Optional. If supplied, used to set the initial value of the on_changed event handler.
on_changed
$on_changed = $self->on_changed
$self->set_on_changed( $on_changed )
Return or set the CODE reference to be called when the chosen selection is changed.
$on_changed->( $choice, $value )
$choice->push_choice( $value, $caption )
Appends another choice to the list of choices, with the given value and display caption.
$value = $choice->chosen_value
Returns the value of the currently-chosen choice.
$choice->choose_by_idx( $idx )
Moves the chosen choice to the one at the given index. If this wasn't the previously-chosen one, invokes the on_changed event.
$choice->choose_by_value( $value )
Moves the chosen choise to the one having the given value, if such a choice exists. If this wasn't the previously-chosen one, invokes the on_changed event.
$choice->popup_menu
Display the popup menu in a modal float until a choice is made.
Render a full border around the widget if height is at least 3.
Paul Evans <leonerd@leonerd.org.uk>
To install Tickit::Widget::Choice, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tickit::Widget::Choice
CPAN shell
perl -MCPAN -e shell install Tickit::Widget::Choice
For more information on module installation, please visit the detailed CPAN module installation guide.