[−][src]Crate suzy
Create an application with Suzy
Suzy allows you to create a GUI comprised of widgets.
The most basic app template will look something like this:
#[derive(Default)] struct Data { } impl WidgetContent for Data { fn init<I: WidgetInit<Self>>(_init: I) {} fn children<R: WidgetChildReceiver>(&mut self, _receiver: R) {} fn graphics<R: WidgetGraphicReceiver>(&mut self, _receiver: R) {} } fn main() { Data::run_as_app(); }
Watch System
Suzy's watch system provides the main way to define functionality within the framework. It enables you to describe the relationships between widgets in a declarative way.
For example, if you wanted to make a widget half the width of its parent:
init.watch(|this, rect| { this.child.set_width(rect.width() / 2.0); });
When the parent changes size, the closure will be re-run and update the size of the child.
See the watch
module documentation for more
information about the watch system.
Modules
adapter | The Adaptable trait is the primary way for a Widget to update it's visuals in response to a change in an external data source. |
animation | Animations integrate with Suzy's watch system to interpolate values over time. |
app | An App describes the context in which widgets exist. |
dims | Types dealing with the dimensions of widgets. |
graphics | Graphics control the visual appearance of Widgets. |
platform | A flexible interface for the low-level aspects of the GUI system. |
pointer | Pointer events are considered the primary input mechanism. |
selectable | An interface for Widgets to respond to interaction. |
units | Convenience functions to convert between measurable units of visible size. |
watch | Suzy's watch system provides the main way to define functionality within the framework. It enables you to describe the relationships between widgets in a declaritive way. |
widget | This module contains all the types associated with defining custom widgets. |
widgets | Suzy comes with a set of built-in widgets. |
window | Types associated with the creation and control of windows. |
Macros
tweak | A version of the tweak! macro from the crate
|