Struct dotrix_egui::Button[][src]

pub struct Button { /* fields omitted */ }
Expand description

Clickable button with text.

See also Ui::button.

if ui.add(egui::Button::new("Click mew")).clicked() {
    do_stuff();
}

Implementations

Override background fill color. Note that this will override any on-hover effects. Calling this will also turn on the frame.

Override button stroke. Note that this will override any on-hover effects. Calling this will also turn on the frame.

Make this a small button, suitable for embedding into text.

Turn off the frame

By default, buttons senses clicks. Change this to a drag-button with Sense::drag().

If you set this to false, the button will be grayed out and un-clickable. enabled(false) has the same effect as calling sense(Sense::hover()).

This is a convenience for Ui::set_enabled.

If true, the text will wrap at the max_width. By default Self::wrap will be true in vertical layouts and horizontal layouts with wrapping, and false on non-wrapping horizontal layouts.

Note that any \n in the button text will always produce a new line.

Trait Implementations

Allocate space, interact, paint, and return a Response. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Constructs wrapped service

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.