[][src]Struct uniui_widget_button::Button

pub struct Button { /* fields omitted */ }

Widget wich have a text and can be pressed by user.

Example (but you're better to use macros insted):

let slot_button_clicked = SlotImpl::new();
let button = Button::new("PushMe".to_owned());
button.signal_clicked().connect_slot(&slot_button_clicked);

Macros

You may be interested in u_button! macros to simplify Button creation. Better example with macros:

use uniui_widget_button::prelude::*;

let slot_button_clicked = SlotImpl::new();

let button = u_buton! {
    text: "PushMe".to_owned(),
    signal_clicked: &slot_button_clicked,
};

Implementations

impl Button[src]

pub fn new(text: String) -> Self[src]

Creates new Button with predefined text on it

pub fn signal_clicked(&mut self) -> &mut Signal<()>[src]

The signal will be triggered every time user clicks the button.

You can connect your slots to the signal to receive notification about user clicks.

Trait Implementations

impl DataProcessor for Button[src]

impl Widget for Button[src]

Auto Trait Implementations

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.