For those interested in cross-platform GUI development, our newest entry is nora - a prototype for creating an adaptive UI that can target both desktop and mobile devices from the same codebase.
To have something to play with, we simply expose the nim-web3 JSON-RPC library calls.
Depending on the aspect ratio of screen essentially, the UI will show up either in landscape or portrait mode and adjust what is shown on screen.
Behind the scenes, a few things are going on:
- multithreading: UI in one thread, networking in another with a channel between them - this is an easy way to let two frameworks (qt and chronos in this case) that each have their own event loop to interact - basically, the channel acts as a bridge between the two loops and neither ends up blocking the other (ie no screen freezes while making a web request) - the channel itself actually consists of two unidirectional message passing interfaces with implementations based on the type of event loop
- a new macro/DSL for Qt is taking shape - in particular, it allows exposing Nim objects to the Qt metaobject type introspection system which in turns allows runtime access to the data from JavaScript in the UI (via the QML markup language)
- the DSL helps guide development of seaqt
- build can target both desktop (ie linux) and mobile (ie android) by leveraging Qt's interop capabilities and a few tricks lifted from https://github.com/planetis-m/naylib/blob/main/manual/advanced_usage.md#building-for-android (thanks!)
- application can also be built as a plugin, providing a path for it to be integrating in UI developer tooling like Developer Studio that introspects the plugin based on the above metaobject data - potentially, this can also be used to create "extensible" UIs where plugins can show their own screens (though more work is required for seamless composition and process isolation)
Enjoy, and feedback welcome - the usable parts will eventually trickle down to the various libraries and applications we're building.