Tickit::Widget::Choice - a widget giving a choice from a list
$choice = Tickit::Widget::Choice->new( %args )
Constructs a new
Takes the following named arguments
- choices => ARRAY
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_choicefor each element in the array.
- on_changed => CODE
Optional. If supplied, used to set the initial value of the
$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
$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
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 <firstname.lastname@example.org>