[−][src]Trait kas::event::Handler
Event-handling aspect of a widget.
This is a companion trait to Widget
. It can (optionally) be implemented
by the derive(Widget)
macro, or can be implemented manually.
Associated Types
type Response: From<NoResponse>
Type of message returned by this handler.
This mechanism allows type-safe handling of user-defined responses to handled actions. For example, a user may define a control panel where each button returns a unique code, or a configuration editor may return a full copy of the new configuration on completion.
Required methods
fn handle_action(
&mut self,
tk: &dyn TkWidget,
action: Action,
number: u32
) -> Self::Response
&mut self,
tk: &dyn TkWidget,
action: Action,
number: u32
) -> Self::Response
Handle a high-level event directed at the widget identified by number
,
and return a user-defined msg.
Implementors
impl Handler for Entry<()>
[src]
impl Handler for Entry<()>
type Response = NoResponse
fn handle_action( | [src] |
impl Handler for Text
[src]
impl Handler for Text
type Response = NoResponse
fn handle_action( | [src] |
impl<R: From<NoResponse>, H: Fn() -> R> Handler for TextButton<H>
[src]
impl<R: From<NoResponse>, H: Fn() -> R> Handler for TextButton<H>
type Response = R
fn handle_action( | [src] |
impl<R: From<NoResponse>, H: Fn() -> R> Handler for Entry<H>
[src]
impl<R: From<NoResponse>, H: Fn() -> R> Handler for Entry<H>