[][src]Struct newt::widgets::form::Form

pub struct Form<'a> { /* fields omitted */ }

Displays Components and accepts user input.

Implementations

impl<'a> Form<'a>[src]

pub fn new(scrollbar: Option<&VerticalScrollbar>, flags: i32) -> Form<'a>[src]

Creates a new Form.

pub fn new_with_help_callback<FN, T>(
    scrollbar: Option<&VerticalScrollbar>,
    flags: i32,
    function: FN,
    data: Option<T>
) -> (Form<'a>, Box<HelpCallback<'a, FN, T>>) where
    FN: Fn(&Form, Option<&T>), 
[src]

Creates a new Form with an associated help HelpCallback. See HelpCallback for additional information.

pub fn add_component(
    &mut self,
    component: &'a dyn Component
) -> Result<(), &'static str>
[src]

Add a Component to the Form to be displayed when the Form is run.

pub fn add_components<'t>(
    &mut self,
    components: &'t [&'a dyn Component]
) -> Result<(), &'static str>
[src]

Add multiple Components to the Form.

pub fn take_component<T>(&mut self, component: T) -> Result<(), &'static str> where
    T: Component
[src]

Add a Component to the Form, taking ownership.

pub fn set_height(&self, height: i32)[src]

Set the height of the Form.

pub fn set_width(&self, width: i32)[src]

Set the width of the Form.

pub fn set_size(&self)[src]

Tell the Form to resize itself.

pub fn add_hot_key(&self, key: i32)[src]

Add an exit hot key to the Form. The Form will stop running when the key is pressed.

pub fn set_timer(&self, millisecs: i32)[src]

Add an exit timer to the Form. The Form will stop running when the timer times out.

  • millisecs - The timer countdown in milliseconds.

pub fn watch_fd(&self, fd: RawFd, flags: FDFlags)[src]

Add a file descriptor for the Form to watch. The Form will stop running when the specified activity occurs on the file descriptor.

  • fd - The file descriptor to watch.
  • flags - Flags specifying the activity to watch for.

pub fn get_current(&self) -> Box<dyn Component>[src]

Get the Form's currently focused Component.

pub fn set_current(&self, subcomponent: &dyn Component)[src]

Set the Form's currently focused Component.

pub fn set_background(&self, color: i32)[src]

Set the Form's background color.

pub fn get_scroll_position(&self) -> i32[src]

pub fn set_scroll_position(&self, position: i32)[src]

pub fn run(&self) -> Result<ExitReason, ()>[src]

Run the form displaying all added components and accepting input from the user.

pub fn draw(&self)[src]

Redraw the Form.

Trait Implementations

impl<'a> Component for Form<'a>[src]

impl<'a> Drop for Form<'a>[src]

impl<'a> PartialEq<Box<dyn Component + 'static>> for Form<'a>[src]

impl<'a> PartialEq<ExitReason> for Form<'a>[src]

impl<'a, Rhs: Component> PartialEq<Rhs> for Form<'a>[src]

impl<'a> WidgetFns for Form<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Form<'a>

impl<'a> !Send for Form<'a>

impl<'a> !Sync for Form<'a>

impl<'a> Unpin for Form<'a>

impl<'a> !UnwindSafe for Form<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WidgetFns for T where
    T: Grid, 
[src]