#[repr(C)]pub struct TreeView {
pub root: TreeViewNode,
pub on_node_click: OptionTreeViewOnNodeClick,
}Expand description
Hierarchical tree view widget with expandable/collapsible nodes.
Fields§
§root: TreeViewNodeRoot node of the tree hierarchy.
on_node_click: OptionTreeViewOnNodeClickOptional callback fired when any node is clicked.
Implementations§
Source§impl TreeView
impl TreeView
Sourcepub fn new(root: TreeViewNode) -> Self
pub fn new(root: TreeViewNode) -> Self
Creates a new tree view with the given root node and no click callback.
Sourcepub fn set_on_node_click<C: Into<TreeViewOnNodeClickCallback>>(
&mut self,
data: RefAny,
callback: C,
)
pub fn set_on_node_click<C: Into<TreeViewOnNodeClickCallback>>( &mut self, data: RefAny, callback: C, )
Sets the callback invoked when any tree node is clicked.
Sourcepub fn with_on_node_click<C: Into<TreeViewOnNodeClickCallback>>(
self,
data: RefAny,
callback: C,
) -> Self
pub fn with_on_node_click<C: Into<TreeViewOnNodeClickCallback>>( self, data: RefAny, callback: C, ) -> Self
Builder method: sets the node-click callback.
Trait Implementations§
impl StructuralPartialEq for TreeView
Auto Trait Implementations§
impl Freeze for TreeView
impl RefUnwindSafe for TreeView
impl Send for TreeView
impl Sync for TreeView
impl Unpin for TreeView
impl UnsafeUnpin for TreeView
impl UnwindSafe for TreeView
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more