NAME `Tickit::Widget::Choice' - a widget giving a choice from a list CONSTRUCTOR $choice = Tickit::Widget::Choice->new( %args ) Constructs a new `Tickit::Widget::Choice' object. 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_choice' for each element in the array. on_changed => CODE Optional. If supplied, used to set the initial value of the `on_changed' event handler. ACCESSORS $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 ) METHODS $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. AUTHOR Paul Evans