Crate gooey

Source
Expand description

§gooey

UI library

A gooey Interface is defined as a layer between an Application and a Presentation backend.

An Application implementation can handle Callbacks on model data bound to the Interface, and a Presentation backend can receive Input from the user or OS and display a view of the interface.

use gooey::{application, presentation, widget, Presentation};
use gooey::interface::{self, Interface, view};
// create a default interface with a headless presentation layer that reads
// from stdin and ignores all display values
let mut interface =
  presentation::Headless::make_interface::<application::Default>();
// attach a widget to the root node
let root_id = interface.root_id().clone();
let action  = interface::Action::create_singleton (
  widget::playback::new (None), interface::CreateOrder::Append);
for event in interface.action (&root_id, action) {
  // ... model events
}
// get stdin and update the interface
for event in interface.update() {
  // ... model events
}
interface.display();  // no-op

See ./examples/ for complete examples.

Re-exports§

pub use self::application::Application;
pub use self::interface::Interface;
pub use self::presentation::Presentation;
pub use self::utils::TreeHelper;
pub use self::widget::Widget;
pub use id_tree as tree;
pub use nsys::math;

Modules§

application
Application layer.
geometry
Geometry utilities
interface
Interface layer.
prelude
Convenience re-exports
presentation
Presentation layer.
utils
Utility functions
widget
Contextual interface elements.

Macros§

def_callback_ids
Define an enum where each variant derefs into an application Callback
extend_control
Defines one or more extended control Ids for a Control type

Structs§

Tree
A tree structure consisting of Nodes.

Functions§

report_sizes
Diagnostic print sizes of various types