pub struct SnarlWidget { /* private fields */ }Implementations§
Source§impl SnarlWidget
impl SnarlWidget
Sourcepub fn get_selected_nodes(self, ui: &Ui) -> Vec<NodeId>
pub fn get_selected_nodes(self, ui: &Ui) -> Vec<NodeId>
Returns list of nodes selected in the UI for the SnarlWidget with same id.
Use same Ui instance that was used in SnarlWidget::show.
Sourcepub fn get_selected_nodes_at(self, ui_id: Id, ctx: &Context) -> Vec<NodeId>
pub fn get_selected_nodes_at(self, ui_id: Id, ctx: &Context) -> Vec<NodeId>
Returns list of nodes selected in the UI for the SnarlWidget with same id.
ui_id must be the Id of the Ui instance that was used in SnarlWidget::show.
Source§impl SnarlWidget
impl SnarlWidget
Sourcepub fn new() -> Self
pub fn new() -> Self
Returns new SnarlWidget with default parameters.
Sourcepub const fn id(self, id: Id) -> Self
pub const fn id(self, id: Id) -> Self
Assign an explicit and globally unique Id.
Use this if you want to persist the state of the widget when it changes position in the widget hierarchy.
Prefer using SnarlWidget::id_salt otherwise.
Sourcepub fn id_salt(self, id_salt: impl Hash) -> Self
pub fn id_salt(self, id_salt: impl Hash) -> Self
Assign a source for the unique Id
It must be locally unique for the current Ui hierarchy position.
Ignored if SnarlWidget::id was set.
Sourcepub const fn style(self, style: SnarlStyle) -> Self
pub const fn style(self, style: SnarlStyle) -> Self
Set style parameters for the Snarl widget.
Trait Implementations§
Source§impl Clone for SnarlWidget
impl Clone for SnarlWidget
Source§fn clone(&self) -> SnarlWidget
fn clone(&self) -> SnarlWidget
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SnarlWidget
impl Debug for SnarlWidget
Source§impl Default for SnarlWidget
impl Default for SnarlWidget
impl Copy for SnarlWidget
Auto Trait Implementations§
impl Freeze for SnarlWidget
impl RefUnwindSafe for SnarlWidget
impl Send for SnarlWidget
impl Sync for SnarlWidget
impl Unpin for SnarlWidget
impl UnwindSafe for SnarlWidget
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