pub struct Ui { /* private fields */ }
Expand description
Main UI builder - provides immediate mode UI building
Implementations§
Source§impl Ui
impl Ui
pub fn new(plugin_id: String) -> Arc<Mutex<Self>>
Add a clickable button
Sourcepub fn text_edit_singleline(&mut self, value: &mut String) -> Response
pub fn text_edit_singleline(&mut self, value: &mut String) -> Response
Add a single-line text editor
Sourcepub fn combo_box<T>(
&mut self,
options: Vec<T>,
selected: &mut Option<T>,
placeholder: &str,
) -> Response
pub fn combo_box<T>( &mut self, options: Vec<T>, selected: &mut Option<T>, placeholder: &str, ) -> Response
Add a combo box (dropdown) widget
Sourcepub fn horizontal<R>(&mut self, add_contents: impl FnOnce(&mut Self) -> R) -> R
pub fn horizontal<R>(&mut self, add_contents: impl FnOnce(&mut Self) -> R) -> R
Create a horizontal layout
Sourcepub fn vertical<R>(&mut self, add_contents: impl FnOnce(&mut Self) -> R) -> R
pub fn vertical<R>(&mut self, add_contents: impl FnOnce(&mut Self) -> R) -> R
Create a vertical layout
Sourcepub fn get_components(&self) -> &[UiComponent]
pub fn get_components(&self) -> &[UiComponent]
Get all components for serialization
Sourcepub fn clear_components_only(&mut self)
pub fn clear_components_only(&mut self)
Clear only components, keep event tracking for current frame
Sourcepub fn clear_events(&mut self)
pub fn clear_events(&mut self)
Clear event tracking after update_ui is complete
Sourcepub fn handle_ui_event(&mut self, component_id: &str, value: &str) -> bool
pub fn handle_ui_event(&mut self, component_id: &str, value: &str) -> bool
Handle UI events (called when frontend sends UI events)
Auto Trait Implementations§
impl Freeze for Ui
impl RefUnwindSafe for Ui
impl Send for Ui
impl Sync for Ui
impl Unpin for Ui
impl UnwindSafe for Ui
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