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 -
trueto "inhibit" and not let the signal pass up the inheritance to other handlers, andfalseto let it. WoAB cannot automatically detect which signals need it and which not, and will returnNoneby default. To set the value, use#[signal(inhibit = ...)]on the signal variant in theBuilderSignalderive macro or use theinhibit()method ofBuilderConnector. - If multiple tagged signals are streamed to the same actor - which is the
typical use case for tagged signals -
StreamHandler::finishedshould 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 thefinish()method of the builder connector.
License
Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT))