pub fn start(&mut self) -> &I {
        self.build_lines();
        self.print_lines();

        self.up_keys.push(self.default_up);
        self.down_keys.push(self.default_down);

        loop {
            let event = read().unwrap();

            if event
                == Event::Key(KeyEvent {
                    code: KeyCode::Enter,
                    modifiers: KeyModifiers::NONE,
                })
            {
                break;
            }
            if self.event_contains_key(event, &self.up_keys) {
                self.move_up();
                self.call_event_handler_if_supplied(SelectDialogKey::UpKey);
                continue;
            } else if self.event_contains_key(event, &self.down_keys) {
                self.move_down();
                self.call_event_handler_if_supplied(SelectDialogKey::DownKey);
                continue;
            }
        }
        &self.items.to_owned()[self.selected_item]
    }
/// Starts the Select Dialog and waits for the users input. The return is a reference to the chosen item
Starts the Select Dialog and waits for the users input. The return is a reference to the chosen item
Starts the Select Dialog and waits for the users input . The return is a reference to the chosen item
pub fn start(&mut self) -> &I {
        self.build_lines();
        self.print_lines();
        self.up_keys.push(self.default_up);
        self.down_keys.push(self.default_down);
        loop {
            let event = read().unwrap();
            if event
                == Event::Key(KeyEvent {
                    code: KeyCode::Enter,
                    modifiers: KeyModifiers::NONE,
                })
            {
                break;
            }
            if self.event_contains_key(event, &self.up_keys) {
                self.move_up();
                self.call_event_handler_if_supplied(SelectDialogKey::UpKey);
                continue;
            } else if self.event_contains_key(event, &self.down_keys) {
                self.move_down();
                self.call_event_handler_if_supplied(SelectDialogKey::DownKey);
                continue;
            }
        }
        &self.items.to_owned()[self.selected_item]
    }
pub fn start ( & mut self ) -> & I { self . build_lines ( ) ; self . print_lines ( ) ; self . up_keys . push ( self . default_up ) ; self . down_keys . push ( self . default_down ) ; loop { let event = read ( ) . unwrap ( ) ; if event == Event :: Key ( KeyEvent { code : KeyCode :: Enter , modifiers : KeyModifiers :: NONE , } ) { break ; } if self . event_contains_key ( event , & self . up_keys ) { self . move_up ( ) ; self . call_event_handler_if_supplied ( SelectDialogKey :: UpKey ) ; continue ; } else if self . event_contains_key ( event , & self . down_keys ) { self . move_down ( ) ; self . call_event_handler_if_supplied ( SelectDialogKey :: DownKey ) ; continue ; } } & self . items . to_owned ( ) [ self . selected_item ] }
Starts the Select Dialog and waits for the users input.
Starts the Select Dialog and waits for the users input .
&mut self
&mut self