Macro implement_widget_traits

Source
macro_rules! implement_widget_traits {
    ($widget_name:ident, $window_field:ident) => { ... };
}
Expand description

Implements common widget traits.

This macro generates implementations for:

  • WxWidget trait
  • Deref/DerefMut to Window
  • WxEvtHandler trait
  • Drop implementation with empty body (for child widgets)

§Parameters

  • name - The name of the widget struct
  • field - The name of the field within the struct that is a Window

§Example

implement_widget_traits!(MyWidget, window_field);