[−][src]Module pixel_widgets::widget
User interface widgets
Widgets in pixel-widgets are defined using the Widget
trait.
You can choose to implement widgets yourself, or you can use the built in widgets that come with pixel-widgets:
Since pixel-widgets rebuilds the whole ui every time the Model
is modified,
most widgets need to keep track of some kind of state across rebuilds. You can manually supply these state
objects in your view
implementation, or you can use a
ManagedState
, which tracks state for your widgets using user defined ids.
When implementing custom widgets, you need to make sure that the custom widgets do not remember absolute layouts.
Widgets like Scroll
can change the layout without needing a rebuild of the ui.
Re-exports
pub use self::button::Button; |
pub use self::column::Column; |
pub use self::drag_drop::Drag; |
pub use self::drag_drop::Drop; |
pub use self::dropdown::Dropdown; |
pub use self::dummy::Dummy; |
pub use self::frame::Frame; |
pub use self::image::Image; |
pub use self::input::Input; |
pub use self::layers::Layers; |
pub use self::menu::Menu; |
pub use self::panel::Panel; |
pub use self::progress::Progress; |
pub use self::row::Row; |
pub use self::scroll::Scroll; |
pub use self::space::Space; |
pub use self::text::Text; |
pub use self::toggle::Toggle; |
pub use self::window::Window; |
Modules
button | A clickable button |
column | Layout child widgets vertically |
drag_drop | Drag and drop zones |
dropdown | Pick an item from a dropdown box |
dummy | Dummy widget that has a custom widget name |
frame | A widget that wraps around a content widget |
image | Just an image |
input | Editable text input |
layers | Stack child widgets on top of each other, while only the topmost receives events. |
menu | A context menu with nestable items |
panel | A panel with a fixed size and location within it's parent |
progress | A bar that fills up according to a value. |
row | Layout child widgets horizontally |
scroll | View a small section of larger widget, with scrollbars. |
space | Empty widget |
text | Widget that renders a paragraph of text. |
toggle | A clickable button that toggles some |
window | A window with a title and a content widget that can be moved by dragging the title. |
Structs
Context | Context for posting messages and requesting redraws of the ui. |
Node | Generic ui widget. |
Traits
IntoNode | Convert to a generic widget. All widgets should implement this trait. It is also implemented by |
Widget | A user interface widget. |
Type Definitions
StateVec | Storage for style states |