Skip to main content

ExternalCtxHandler

Type Alias ExternalCtxHandler 

Source
pub type ExternalCtxHandler = Box<dyn FnMut(&(dyn Any + Send), &mut EventContext<'_>) -> bool>;
Expand description

An app-supplied router for AppEvent::External payloads that need to perform window operations — open a window, focus one, look one up by its string id.

Registered with TeksiloAppBuilder::on_external_with_ctx. Returns true to say “this payload was mine”; false leaves it unclaimed.

The plain on_app_event hook receives only &AppEvent — no tree, no WindowOps — so a handler there cannot call open_window at all: EventContext::open_window panics on a standalone context. This one runs against a real window’s tree with a real ops sink, which is what makes the multi-window recipes in docs/multi-window.md reachable from a background thread (a single-instance app’s IPC listener being the motivating case: a second launch forwards its command line and the running process opens the document window).

Aliased Type§

pub struct ExternalCtxHandler(/* private fields */);