[go: up one dir, main page]

Struct egui::WidgetInfo[][src]

pub struct WidgetInfo {
    pub typ: WidgetType,
    pub label: Option<String>,
    pub edit_text: Option<String>,
    pub selected: Option<bool>,
    pub value: Option<f64>,
}

Describes a widget such as a crate::Button or a crate::TextEdit.

Fields

typ: WidgetType

The type of widget this is.

label: Option<String>

The text on labels, buttons, checkboxes etc.

edit_text: Option<String>

The contents of some editable text (for TextEdit fields).

selected: Option<bool>

The current value of checkboxes and radio buttons.

value: Option<f64>

The current value of sliders etc.

Implementations

impl WidgetInfo[src]

pub fn new(typ: WidgetType) -> Self[src]

pub fn labeled(typ: WidgetType, label: impl Into<String>) -> Self[src]

pub fn selected(
    typ: WidgetType,
    selected: bool,
    label: impl Into<String>
) -> Self
[src]

checkboxes, radio-buttons etc

pub fn drag_value(value: f64) -> Self[src]

pub fn slider(value: f64, label: impl Into<String>) -> Self[src]

pub fn text_edit(edit_text: impl Into<String>) -> Self[src]

pub fn description(&self) -> String[src]

This can be used by a text-to-speech system to describe the widget.

Trait Implementations

impl Clone for WidgetInfo[src]

impl Debug for WidgetInfo[src]

impl PartialEq<WidgetInfo> for WidgetInfo[src]

impl StructuralPartialEq for WidgetInfo[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.