pub trait ListViewDelegate {
    const NAME: &'static str;
Show 17 methods fn did_load(&mut self, view: ListView); fn number_of_items(&self) -> usize; fn item_for(&self, row: usize) -> ListViewRow; fn subclass_name(&self) -> &'static str { ... } fn will_display_item(&self, row: usize) { ... } fn item_selected(&self, row: Option<usize>) { ... } fn context_menu(&self) -> Vec<MenuItem> { ... } fn actions_for(&self, row: usize, edge: RowEdge) -> Vec<RowAction> { ... } fn will_appear(&self, animated: bool) { ... } fn did_appear(&self, animated: bool) { ... } fn will_disappear(&self, animated: bool) { ... } fn did_disappear(&self, animated: bool) { ... } fn dragging_entered(&self, info: DragInfo) -> DragOperation { ... } fn prepare_for_drag_operation(&self, info: DragInfo) -> bool { ... } fn perform_drag_operation(&self, info: DragInfo) -> bool { ... } fn conclude_drag_operation(&self, info: DragInfo) { ... } fn dragging_exited(&self, info: DragInfo) { ... }
}

Required Associated Constants

Used to cache subclass creations on the Objective-C side. You can just set this to be the name of your view type. This value must be unique per-type.

Required Methods

Called when the View is ready to work with. You’re passed a View - this is safe to store and use repeatedly, but it’s not thread safe - any UI calls must be made from the main thread!

Returns the number of items in the list view.

This is temporary and you should not rely on this signature if you choose to try and work with this. NSTableView & such associated delegate patterns are tricky to support in Rust, and while I have a few ideas about them, I haven’t had time to sit down and figure them out properly yet.

Provided Methods

You should rarely (read: probably never) need to implement this yourself. It simply acts as a getter for the associated NAME const on this trait.

Called when an item will be displayed.

Called when an item has been selected (clicked/tapped on). If the selection was cleared, then this will be called with None.

Called when the menu for the tableview is about to be shown. You can update the menu here depending on, say, what the user has context-clicked on. You should avoid any expensive work in here and return the menu as fast as possible.

An optional delegate method; implement this if you’d like swipe-to-reveal to be supported for a given row by returning a vector of actions to show.

Called when this is about to be added to the view heirarchy.

Called after this has been added to the view heirarchy.

Called when this is about to be removed from the view heirarchy.

Called when this has been removed from the view heirarchy.

Invoked when the dragged image enters destination bounds or frame; returns dragging operation to perform.

Invoked when the image is released, allowing the receiver to agree to or refuse drag operation.

Invoked after the released image has been removed from the screen, signaling the receiver to import the pasteboard data.

Invoked when the dragging operation is complete, signaling the receiver to perform any necessary clean-up.

Invoked when the dragged image exits the destination’s bounds rectangle (in the case of a view) or its frame rectangle (in the case of a window object).

Implementors