Struct rustty_oxide::CheckButton [] [src]

pub struct CheckButton { /* fields omitted */ }

Methods

impl CheckButton
[src]

A simple check button that manages an internal state which determines if the button is to be checked or not. The actual checking is handled by the user during an event loop.

Examples

use oxide::core::{HorizontalAlign, VerticalAlign, ButtonResult, Widget, Button};
use oxide::{Dialog, CheckButton};

let mut dlg = Dialog::new(60, 10);

let mut b1 = CheckButton::new("Foo", 'f', ButtonResult::Ok);
b1.pack(&dlg, HorizontalAlign::Left, VerticalAlign::Bottom, (1,1));
// Change the initial state of the button to checked
b1.pressed();

dlg.add_button(b1);

// Now switch the state of the button bound to Ok, which unchecks b1
dlg.button_pressed(ButtonResult::Ok);

[src]

Constructs a new CheckButton, asking for the text to be displayed by the button, the key to map to, and the result returned when the key is detected.

Examples

use oxide::core::ButtonResult;
use oxide::CheckButton;

let mut b1 = CheckButton::new("Foo", 'f', ButtonResult::Ok);

Trait Implementations

impl Button for CheckButton
[src]

[src]

Return the char that is acting as the key in the Button

[src]

Return the ButtonResult which would be returned if the key is detected Read more

[src]

If a button is to do some special action upon being pressed, then this function will do so. StdButton for example does nothing when pressed, while CheckButton changes it's ballot Read more

[src]

If a button has a state involved, e.g. needs to keep track of a certain event, this function will return the state of the button. Read more

impl Widget for CheckButton
[src]

[src]

Draws the widget to the valid CellAccessor passed

[src]

Aligns the widget with the parent as reference

[src]

Expose the painter trait draw_box for all widgets, which outlines the space enclosed within the widget Read more

[src]

Resize the given widget to new dimensions given by Size

[src]

Return a reference the renderer, Base in general cases

[src]

Return a mutable reference to the renderer, Base in general cases