Struct druid::ListenerCtx

source ·
pub struct ListenerCtx<'a> { /* private fields */ }
Expand description

The context given to listeners.

Listeners are allowed to poke widgets and mutate the graph.

Implementations

Bubble a poke action up the widget hierarchy, until a widget handles it.

Returns true if any widget handled the action.

Request the window to be closed.

Methods from Deref<Target = Ui>

Send an arbitrary payload to a widget. The type and interpretation of the payload depends on the specific target widget.

Put a widget in the graph and add its children. Returns newly allocated id for the node.

Set the focused widget.

Add a listener that expects a specific type.

Add a child dynamically, in the last position.

Add a child dynamically, before the given sibling.

Remove a child.

Can panic if child is not a valid child. The child is not deleted, but can be added again later. The listeners for the child are not cleared.

Delete a child.

Can panic if child is not a valid child. Deletes the subtree rooted at the child, drops those widgets, and clears all listeners. The id of the child may be reused; callers should take care not to use the child id in any way afterwards.

Trait Implementations

The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.