Struct egui::output::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]
impl WidgetInfo
[src]pub fn new(typ: WidgetType) -> Self
[src]
pub fn labeled(typ: WidgetType, label: impl ToString) -> Self
[src]
pub fn selected(typ: WidgetType, selected: bool, label: impl ToString) -> Self
[src]
pub fn selected(typ: WidgetType, selected: bool, label: impl ToString) -> Self
[src]checkboxes, radio-buttons etc
pub fn drag_value(value: f64) -> Self
[src]
pub fn slider(value: f64, label: impl ToString) -> Self
[src]
pub fn text_edit(edit_text: impl ToString) -> Self
[src]
pub fn description(&self) -> String
[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 Clone for WidgetInfo
[src]fn clone(&self) -> WidgetInfo
[src]
fn clone(&self) -> WidgetInfo
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for WidgetInfo
[src]
impl Debug for WidgetInfo
[src]impl PartialEq<WidgetInfo> for WidgetInfo
[src]
impl PartialEq<WidgetInfo> for WidgetInfo
[src]fn eq(&self, other: &WidgetInfo) -> bool
[src]
fn eq(&self, other: &WidgetInfo) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &WidgetInfo) -> bool
[src]
fn ne(&self, other: &WidgetInfo) -> bool
[src]This method tests for !=
.
impl StructuralPartialEq for WidgetInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for WidgetInfo
impl Send for WidgetInfo
impl Sync for WidgetInfo
impl Unpin for WidgetInfo
impl UnwindSafe for WidgetInfo
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more