Struct fyrox_ui::button::ButtonBuilder
source · pub struct ButtonBuilder { /* private fields */ }Expand description
Button builder is used to create Button widget instances.
Implementations§
source§impl ButtonBuilder
impl ButtonBuilder
sourcepub fn new(widget_builder: WidgetBuilder) -> Self
pub fn new(widget_builder: WidgetBuilder) -> Self
Creates a new button builder with a widget builder instance.
sourcepub fn with_text(self, text: &str) -> Self
pub fn with_text(self, text: &str) -> Self
Sets the content of the button to be ButtonContent::Text (text with the default font).
sourcepub fn with_text_and_font(self, text: &str, font: SharedFont) -> Self
pub fn with_text_and_font(self, text: &str, font: SharedFont) -> Self
Sets the content of the button to be ButtonContent::Text (text with a custom font).
sourcepub fn with_content(self, node: Handle<UiNode>) -> Self
pub fn with_content(self, node: Handle<UiNode>) -> Self
Sets the content of the button to be ButtonContent::Node (arbitrary widget handle).
sourcepub fn with_back(self, decorator: Handle<UiNode>) -> Self
pub fn with_back(self, decorator: Handle<UiNode>) -> Self
Specifies the widget that will be used as a content holder of the button. By default it is an
instance of crate::decorator::Decorator widget. Usually, this widget should respond to mouse
events to highlight button state (hovered, pressed, etc.)
sourcepub fn build(self, ctx: &mut BuildContext<'_>) -> Handle<UiNode>
pub fn build(self, ctx: &mut BuildContext<'_>) -> Handle<UiNode>
Finishes button build and adds to the user interface and returns its handle.
Auto Trait Implementations§
impl !RefUnwindSafe for ButtonBuilder
impl !Send for ButtonBuilder
impl !Sync for ButtonBuilder
impl Unpin for ButtonBuilder
impl !UnwindSafe for ButtonBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere T: 'static,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.