pub struct TreeView<T, A = ()> { /* private fields */ }Expand description
Interactive hierarchical view backed by snapshot nodes or a retained model.
A retained model takes precedence over bound/static snapshot nodes; a bound
snapshot takes precedence over static nodes. Structural snapshot mutations
require Self::bind_nodes. Retained structural edits use
TreeMutationMode::IntentOnly, leaving ownership to callbacks.
§Examples
use ailloli_ui_widgets::controls::{TreeNode, TreeView};
let tree: TreeView<u64> = TreeView::new().node(TreeNode::leaf(1, "README"));
let _ = tree;Implementations§
Source§impl<T: Clone + PartialEq + 'static, A: 'static> TreeView<T, A>
impl<T: Clone + PartialEq + 'static, A: 'static> TreeView<T, A>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an enabled empty snapshot tree with default style.
Selection/expansion are uncontrolled, structural features and
virtualization are off, and mutation mode defaults to ApplyLocal.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new();
let _ = tree;Sourcepub fn node(self, node: TreeNode<T>) -> Self
pub fn node(self, node: TreeNode<T>) -> Self
Appends one static snapshot root.
Retained or bound node sources take precedence when configured.
§Examples
use ailloli_ui_widgets::controls::{TreeNode, TreeView};
let tree: TreeView<u8> = TreeView::new().node(TreeNode::leaf(1, "file"));
let _ = tree;Sourcepub fn nodes(self, nodes: impl IntoIterator<Item = TreeNode<T>>) -> Self
pub fn nodes(self, nodes: impl IntoIterator<Item = TreeNode<T>>) -> Self
Extends static snapshot roots in iterator order.
§Examples
use ailloli_ui_widgets::controls::{TreeNode, TreeView};
let tree: TreeView<u8> = TreeView::new().nodes([TreeNode::leaf(1, "a"), TreeNode::leaf(2, "b")]);
let _ = tree;Sourcepub fn bind_nodes(self, nodes: impl Into<Signal<Vec<TreeNode<T>>>>) -> Self
pub fn bind_nodes(self, nodes: impl Into<Signal<Vec<TreeNode<T>>>>) -> Self
Installs writable snapshot roots, taking precedence over static roots.
This enables local structural drag/edit/create/delete operations. A retained model still takes precedence for rendering.
§Examples
use ailloli_ui_runtime::component::State;
use ailloli_ui_widgets::controls::{TreeNode, TreeView};
let roots = State::new(vec![TreeNode::leaf(1_u8, "file")]);
let tree: TreeView<u8> = TreeView::new().bind_nodes(roots);
let _ = tree;Sourcepub fn model(self, model: TreeModelHandle<T>) -> Self
pub fn model(self, model: TreeModelHandle<T>) -> Self
Uses a retained, revisioned model.
This is recommended for large/incremental trees and takes precedence over
snapshot roots. Expansion comes from the model. Structural editing must
use IntentOnly; the owner then applies model mutations.
§Examples
use ailloli_ui_widgets::controls::{TreeModel, TreeModelHandle, TreeView};
let model = TreeModelHandle::new(TreeModel::<u64>::new());
let tree: TreeView<u64> = TreeView::new().model(model);
let _ = tree;Sourcepub fn selected(self, selected: impl Into<Binding<T>>) -> Self
pub fn selected(self, selected: impl Into<Binding<T>>) -> Self
Sets readable static or reactive selection.
Selection is not writable unless Self::bind_selected was also called.
If called after bind_selected, the prior writable signal is retained for
interaction while this value controls painting/comparison.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().selected(1);
let _ = tree;Sourcepub fn bind_selected(self, selected: impl Into<Signal<T>>) -> Self
pub fn bind_selected(self, selected: impl Into<Signal<T>>) -> Self
Installs readable/writable controlled selection.
Selection callbacks run only when activation targets a different ID.
§Examples
use ailloli_ui_runtime::component::State;
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().bind_selected(State::new(1));
let _ = tree;Sourcepub fn expanded(self, expanded: impl Into<Binding<Vec<T>>>) -> Self
pub fn expanded(self, expanded: impl Into<Binding<Vec<T>>>) -> Self
Sets readable expanded IDs for snapshot trees.
Duplicates are ignored when read. It is not writable unless
bind_expanded was also called; retained models ignore this value.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().expanded(vec![1, 2]);
let _ = tree;Sourcepub fn bind_expanded(self, expanded: impl Into<Signal<Vec<T>>>) -> Self
pub fn bind_expanded(self, expanded: impl Into<Signal<Vec<T>>>) -> Self
Installs readable/writable expanded IDs for snapshot trees.
Retained models use their own expansion state instead.
§Examples
use ailloli_ui_runtime::component::State;
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().bind_expanded(State::new(vec![1]));
let _ = tree;Sourcepub fn bind_command(
self,
command: impl Into<Signal<Option<TreeViewCommand<T>>>>,
) -> Self
pub fn bind_command( self, command: impl Into<Signal<Option<TreeViewCommand<T>>>>, ) -> Self
Installs a writable one-shot editor-command signal.
Present commands are consumed by setting the signal to None during
layout or the next routed event, even when the target cannot begin editing.
§Examples
use ailloli_ui_runtime::component::State;
use ailloli_ui_widgets::controls::{TreeView, TreeViewCommand};
let command = State::new(Some(TreeViewCommand::BeginRename(1_u8)));
let tree: TreeView<u8> = TreeView::new().bind_command(command);
let _ = tree;Sourcepub fn default_expanded(self, id: T) -> Self
pub fn default_expanded(self, id: T) -> Self
Adds one unique uncontrolled initial expansion ID.
It is used only when no explicit expanded binding is configured.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().default_expanded(1).default_expanded(1);
let _ = tree;Sourcepub fn default_expanded_many(self, ids: impl IntoIterator<Item = T>) -> Self
pub fn default_expanded_many(self, ids: impl IntoIterator<Item = T>) -> Self
Replaces uncontrolled initial expansion IDs with unique iterator values.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().default_expanded_many([1, 2, 1]);
let _ = tree;Sourcepub fn disabled(self, disabled: impl Into<Binding<bool>>) -> Self
pub fn disabled(self, disabled: impl Into<Binding<bool>>) -> Self
Sets static or reactive whole-tree disabled state.
Disabled trees are not focusable, ignore input, and paint disabled rows.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().disabled(true);
let _ = tree;Sourcepub fn draggable(self, draggable: impl Into<Binding<bool>>) -> Self
pub fn draggable(self, draggable: impl Into<Binding<bool>>) -> Self
Enables drag gestures when structural mutation capability also exists.
A drag activates after moving more than four logical pixels.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().draggable(true);
let _ = tree;Sourcepub fn mutation_mode(self, mode: impl Into<Binding<TreeMutationMode>>) -> Self
pub fn mutation_mode(self, mode: impl Into<Binding<TreeMutationMode>>) -> Self
Sets reactive local-versus-intent structural mutation policy.
ApplyLocal requires bound snapshot nodes. Retained structural operations
require IntentOnly; retained branch toggles apply locally only in
ApplyLocal.
§Examples
use ailloli_ui_widgets::controls::{TreeMutationMode, TreeView};
let tree: TreeView<u8> = TreeView::new().mutation_mode(TreeMutationMode::IntentOnly);
let _ = tree;Sourcepub fn editable(self, editable: impl Into<Binding<bool>>) -> Self
pub fn editable(self, editable: impl Into<Binding<bool>>) -> Self
Enables inline rename/create editors when mutation capability exists.
Rename commits additionally require an on_rename callback.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().editable(true);
let _ = tree;Sourcepub fn deletable(self, deletable: impl Into<Binding<bool>>) -> Self
pub fn deletable(self, deletable: impl Into<Binding<bool>>) -> Self
Enables built-in Delete behavior when mutation capability exists.
Installing on_shortcut intercepts Delete as a shortcut before built-in
deletion.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().deletable(true);
let _ = tree;Sourcepub fn creatable(self, creatable: impl Into<Binding<bool>>) -> Self
pub fn creatable(self, creatable: impl Into<Binding<bool>>) -> Self
Enables Insert/create commands when mutation capability and a factory exist.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().creatable(true);
let _ = tree;Sourcepub fn create_node_with(
self,
factory: impl Fn(TreeCreateRequest<T>) -> Option<TreeNode<T>> + 'static,
) -> Self
pub fn create_node_with( self, factory: impl Fn(TreeCreateRequest<T>) -> Option<TreeNode<T>> + 'static, ) -> Self
Sets the factory used to construct provisional nodes for create requests.
Returning None rejects the request without editing or callbacks.
§Examples
use ailloli_ui_widgets::controls::{TreeNode, TreeView};
let tree: TreeView<u8> = TreeView::new().create_node_with(|request| Some(TreeNode::leaf(9, request.default_label)));
let _ = tree;Sourcepub fn tree_style(self, style: TreeViewStyle) -> Self
pub fn tree_style(self, style: TreeViewStyle) -> Self
Replaces tree appearance without altering explicit layout declarations.
§Examples
use ailloli_ui_widgets::controls::{TreeView, TreeViewStyle};
let tree: TreeView<u8> = TreeView::new().tree_style(TreeViewStyle::default());
let _ = tree;Sourcepub fn tree_size(self, size: TreeViewSize) -> Self
pub fn tree_size(self, size: TreeViewSize) -> Self
Re-derives every style field from the default theme and density.
Explicit layout declarations remain unchanged.
§Examples
use ailloli_ui_widgets::controls::{TreeView, TreeViewSize};
let tree: TreeView<u8> = TreeView::new().tree_size(TreeViewSize::Compact);
let _ = tree;Sourcepub fn virtualized(self, virtualized: bool) -> Self
pub fn virtualized(self, virtualized: bool) -> Self
Enables viewport row-range layout/paint with eight-row overscan.
A virtual layout without viewport and without finite maximum height falls
back to all rows and increments virtualization_fallbacks.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().virtualized(true);
let _ = tree;Sourcepub fn diagnostics(self, diagnostics: TreeViewDiagnostics) -> Self
pub fn diagnostics(self, diagnostics: TreeViewDiagnostics) -> Self
Attaches shared structural counters, replacing any previous handle.
§Examples
use ailloli_ui_widgets::controls::{TreeView, TreeViewDiagnostics};
let diagnostics = TreeViewDiagnostics::new();
let tree: TreeView<u8> = TreeView::new().diagnostics(diagnostics.clone());
assert_eq!(diagnostics.snapshot().layout_calls, 0);
let _ = tree;Sourcepub fn width(self, value: impl Into<Length>) -> Self
pub fn width(self, value: impl Into<Length>) -> Self
Replaces preferred width; numeric inputs are logical pixels.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().width(320.0);
let _ = tree;Sourcepub fn height(self, value: impl Into<Length>) -> Self
pub fn height(self, value: impl Into<Length>) -> Self
Replaces preferred height; numeric inputs are logical pixels.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().height(480.0);
let _ = tree;Sourcepub fn min_width(self, value: impl Into<Length>) -> Self
pub fn min_width(self, value: impl Into<Length>) -> Self
Replaces the minimum-width declaration.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().min_width(160.0);
let _ = tree;Sourcepub fn max_width(self, value: impl Into<Length>) -> Self
pub fn max_width(self, value: impl Into<Length>) -> Self
Replaces the maximum-width declaration.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().max_width(640.0);
let _ = tree;Sourcepub fn min_height(self, value: impl Into<Length>) -> Self
pub fn min_height(self, value: impl Into<Length>) -> Self
Replaces the minimum-height declaration.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().min_height(120.0);
let _ = tree;Sourcepub fn max_height(self, value: impl Into<Length>) -> Self
pub fn max_height(self, value: impl Into<Length>) -> Self
Replaces the maximum-height declaration.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().max_height(720.0);
let _ = tree;Sourcepub fn fill(self) -> Self
pub fn fill(self) -> Self
Requests parent-fill sizing on both axes.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().fill();
let _ = tree;Sourcepub fn fill_width(self) -> Self
pub fn fill_width(self) -> Self
Requests parent-fill width while preserving height.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().fill_width();
let _ = tree;Sourcepub fn fill_height(self) -> Self
pub fn fill_height(self) -> Self
Requests parent-fill height while preserving width.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().fill_height();
let _ = tree;Sourcepub fn flex_grow(self) -> Self
pub fn flex_grow(self) -> Self
Sets this tree’s flex-grow weight to one.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().flex_grow();
let _ = tree;Sourcepub fn on_select(self, f: impl Fn(T) -> A + 'static) -> Self
pub fn on_select(self, f: impl Fn(T) -> A + 'static) -> Self
Dispatches the action returned when enabled selection changes.
Equal IDs do not emit. Without writable selection, a different row can emit even though controlled painting remains unchanged.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8, u8> = TreeView::new().on_select(|id| id);
let _ = tree;Sourcepub fn on_select_ctx(self, f: impl Fn(&mut EventCtx<A>, T) + 'static) -> Self
pub fn on_select_ctx(self, f: impl Fn(&mut EventCtx<A>, T) + 'static) -> Self
Handles changed selection with direct event-context access.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_select_ctx(|_ctx, _id| {});
let _ = tree;Sourcepub fn on_activate(self, f: impl Fn(T) -> A + 'static) -> Self
pub fn on_activate(self, f: impl Fn(T) -> A + 'static) -> Self
Dispatches the action returned on explicit enabled-row activation.
Activation comes from a qualifying second click or Enter. With this handler installed, Enter activates instead of selecting.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8, u8> = TreeView::new().on_activate(|id| id);
let _ = tree;Sourcepub fn on_activate_ctx(self, f: impl Fn(&mut EventCtx<A>, T) + 'static) -> Self
pub fn on_activate_ctx(self, f: impl Fn(&mut EventCtx<A>, T) + 'static) -> Self
Handles explicit activation with direct event-context access.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_activate_ctx(|_ctx, _id| {});
let _ = tree;Sourcepub fn on_toggle(self, f: impl Fn(T, bool) -> A + 'static) -> Self
pub fn on_toggle(self, f: impl Fn(T, bool) -> A + 'static) -> Self
Dispatches the action returned after a valid branch toggle intent.
The boolean is the requested next expansion state. In retained
IntentOnly mode the model remains unchanged until its owner applies it.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8, bool> = TreeView::new().on_toggle(|_id, open| open);
let _ = tree;Sourcepub fn on_toggle_ctx(
self,
f: impl Fn(&mut EventCtx<A>, T, bool) + 'static,
) -> Self
pub fn on_toggle_ctx( self, f: impl Fn(&mut EventCtx<A>, T, bool) + 'static, ) -> Self
Handles branch toggle intent with direct event-context access.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_toggle_ctx(|_ctx, _id, _open| {});
let _ = tree;Sourcepub fn on_trailing_action(self, f: impl Fn(T) -> A + 'static) -> Self
pub fn on_trailing_action(self, f: impl Fn(T) -> A + 'static) -> Self
Dispatches the action returned by an enabled selected row’s trailing icon.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8, u8> = TreeView::new().on_trailing_action(|id| id);
let _ = tree;Sourcepub fn on_trailing_action_ctx(
self,
f: impl Fn(&mut EventCtx<A>, T) + 'static,
) -> Self
pub fn on_trailing_action_ctx( self, f: impl Fn(&mut EventCtx<A>, T) + 'static, ) -> Self
Handles a trailing action with direct event-context access.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_trailing_action_ctx(|_ctx, _id| {});
let _ = tree;Sourcepub fn on_move(self, f: impl Fn(TreeMove<T>) -> A + 'static) -> Self
pub fn on_move(self, f: impl Fn(TreeMove<T>) -> A + 'static) -> Self
Dispatches the action returned after a valid drag/drop move intent.
ApplyLocal mutates bound snapshot nodes before emitting; IntentOnly
emits without source mutation.
§Examples
use ailloli_ui_widgets::controls::{TreeMove, TreeView};
let tree: TreeView<u8, TreeMove<u8>> = TreeView::new().on_move(|event| event);
let _ = tree;Sourcepub fn on_move_ctx(
self,
f: impl Fn(&mut EventCtx<A>, TreeMove<T>) + 'static,
) -> Self
pub fn on_move_ctx( self, f: impl Fn(&mut EventCtx<A>, TreeMove<T>) + 'static, ) -> Self
Handles drag/drop move intent with direct event-context access.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_move_ctx(|_ctx, _event| {});
let _ = tree;Sourcepub fn on_rename(self, f: impl Fn(TreeRename<T>) -> A + 'static) -> Self
pub fn on_rename(self, f: impl Fn(TreeRename<T>) -> A + 'static) -> Self
Dispatches the action returned for a nonempty committed rename.
Installing a rename handler is required for ordinary rename commits. In local mode bound snapshot labels are changed before emission; intent mode leaves the source unchanged.
§Examples
use ailloli_ui_widgets::controls::{TreeRename, TreeView};
let tree: TreeView<u8, TreeRename<u8>> = TreeView::new().on_rename(|event| event);
let _ = tree;Sourcepub fn on_rename_ctx(
self,
f: impl Fn(&mut EventCtx<A>, TreeRename<T>) + 'static,
) -> Self
pub fn on_rename_ctx( self, f: impl Fn(&mut EventCtx<A>, TreeRename<T>) + 'static, ) -> Self
Handles a committed rename with direct event-context access.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_rename_ctx(|_ctx, _event| {});
let _ = tree;Sourcepub fn on_create(self, f: impl Fn(TreeCreate<T>) -> A + 'static) -> Self
pub fn on_create(self, f: impl Fn(TreeCreate<T>) -> A + 'static) -> Self
Dispatches the action returned for a committed create intent.
Creation also requires creatable, structural mutation capability, and a
factory. External create commands emit the trimmed final editor label.
§Examples
use ailloli_ui_widgets::controls::{TreeCreate, TreeView};
let tree: TreeView<u8, TreeCreate<u8>> = TreeView::new().on_create(|event| event);
let _ = tree;Sourcepub fn on_create_ctx(
self,
f: impl Fn(&mut EventCtx<A>, TreeCreate<T>) + 'static,
) -> Self
pub fn on_create_ctx( self, f: impl Fn(&mut EventCtx<A>, TreeCreate<T>) + 'static, ) -> Self
Handles committed creation with direct event-context access.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_create_ctx(|_ctx, _event| {});
let _ = tree;Sourcepub fn on_create_cancel_ctx(
self,
f: impl Fn(&mut EventCtx<A>, TreeCreateCancel<T>) + 'static,
) -> Self
pub fn on_create_cancel_ctx( self, f: impl Fn(&mut EventCtx<A>, TreeCreateCancel<T>) + 'static, ) -> Self
Handles cancellation of a create editor with direct context access.
Cancellation removes a locally inserted provisional snapshot/draft and carries the original request.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_create_cancel_ctx(|_ctx, _event| {});
let _ = tree;Sourcepub fn on_delete(self, f: impl Fn(TreeDelete<T>) -> A + 'static) -> Self
pub fn on_delete(self, f: impl Fn(TreeDelete<T>) -> A + 'static) -> Self
Dispatches the action returned for deletion of an enabled subtree.
Local mode removes bound snapshot nodes first; intent mode emits only. A configured shortcut handler intercepts Delete before this behavior.
§Examples
use ailloli_ui_widgets::controls::{TreeDelete, TreeView};
let tree: TreeView<u8, TreeDelete<u8>> = TreeView::new().on_delete(|event| event);
let _ = tree;Sourcepub fn on_delete_ctx(
self,
f: impl Fn(&mut EventCtx<A>, TreeDelete<T>) + 'static,
) -> Self
pub fn on_delete_ctx( self, f: impl Fn(&mut EventCtx<A>, TreeDelete<T>) + 'static, ) -> Self
Handles deletion intent with direct event-context access.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_delete_ctx(|_ctx, _event| {});
let _ = tree;Dispatches the action returned for right-click row/blank context.
An enabled row is made active and selected before its callback.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_context_menu(|_event| ());
let _ = tree;Handles right-click context with direct event-context access.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_context_menu_ctx(|_ctx, _event| {});
let _ = tree;Sourcepub fn on_shortcut(self, f: impl Fn(TreeShortcut<T>) -> A + 'static) -> Self
pub fn on_shortcut(self, f: impl Fn(TreeShortcut<T>) -> A + 'static) -> Self
Dispatches supported Delete/Control-C/X/V shortcut intent.
Installing this handler consumes matching shortcuts before built-in Delete. Alt/Meta-modified keys are ignored; Paste may carry no target.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_shortcut(|_event| ());
let _ = tree;Sourcepub fn on_shortcut_ctx(
self,
f: impl Fn(&mut EventCtx<A>, TreeShortcut<T>) + 'static,
) -> Self
pub fn on_shortcut_ctx( self, f: impl Fn(&mut EventCtx<A>, TreeShortcut<T>) + 'static, ) -> Self
Handles supported shortcut intent with direct event-context access.
§Examples
use ailloli_ui_widgets::controls::TreeView;
let tree: TreeView<u8> = TreeView::new().on_shortcut_ctx(|_ctx, _event| {});
let _ = tree;