woab 0.2.0

Bridge between GTK and Actix to create actor-based GUIs
Documentation

Build Status Latest Version Rust Documentation

WoAB

WoAB (Widgets on Actors Bridge) is a library for combining the widgets toolkit GTK with the actors framework Actix. It helps with:

  • Running the actors inside the GTK thread, allowing message handlers to interact with the widgets directly.
  • Routing GTK signals through the asynchronous runtime, so that the code handling them can proceed naturally to interact with the actors.
  • Mapping widgets and signals from Glade XML files to user types.

Refer to the docs for more explanation on how to use WoAB, and to the examples for a short demonstration.

Pitfalls

  • GTK requires some signals to return a boolean value - true to "inhibit" and not let the signal pass up the inheritance to other handlers, and false to let it. WoAB cannot automatically detect which signals need it and which not, and will return None by default. To set the value, use #[signal(inhibit = ...)] on the signal variant in the BuilderSignal derive macro or use the inhibit() method of BuilderConnector.
  • If multiple tagged signals are streamed to the same actor - which is the typical use case for tagged signals - StreamHandler::finished should be overridden to avoid stopping the actor when one instance of the widgets is removed!!!
  • If you connect signals via a builder connector, they will only be connected once the connector is dropped. If you need the signals connected before the connector is naturally dropped (e.g. - if you start gtk::main() in the same scope) use the finish() method of the builder connector.

License

Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT))