[−][src]Macro orbtk_api::widget
Defines a new type of Widget
with its properties and event handlers.
Widgets defined by this macro can be instantiated by calling the new() method.
Inherits default properties from a base widget.
Implements the Widget
trait automatically.
Also the struct serves as a builder
of the builder pattern
.
Syntax:
widget!(MyWidgetName<MyWidgetStateStruct>: Handler1, Handler2, Handler3 { property_name_1: PropertyType1, property_name_2: PropertyType2 });
Examples
Creates a widget named PersonWidget with three properties, without handlers, and with a state struct called WidgetState.
widget!(PersonWidget<WidgetState> { name: String16, age: usize, average: f64 });