If it's built on GTK, it's not "truly native" on anything but Linux (and with the lack of accessibility to boot). If you're not crafting your own NSButtons and such, you are nowhere near "truly native".
Reading the documentation, I just notice lots of familiarity with my own solution using haskell and gi-gtk4. I think that anybody that read https://bichanna.github.io/posts/tea-time/ will get the same ideas. This basically boils down to:
1. Use a native widget system such as GTK (I evaluated Qt too)
2. Wrap widgets into a component datatype that is aware on how to update the widget when the props/model changes.
3. Define a dispatch closure that is passed to widget that accepts messages. Actions on the widgets should use this instead of mutating a reference.
4. That dispatch closure is component aware and it will call the update function on all the widgets.
There are some extra complications for long running computations but the model is a good base to build on. I wish the best to the relm team, most likely I will use them when programminmg in rust.
I haven’t used Haskell much. I thought to try it with agentic help, but then read this post that its compilation times might make it unviable. But what’s your experience?
This is Gnome/GTK, not cross-platform like I would have expected. A Linux-first approach. I’m happy that this is the world we’re in now but expect it still to be royal pain to get a build running on Windows. Huge congrats to everyone involved if not!
You also won't have accessibility on Windows either unless you can somehow get it to enable accesskit integration. (I really don't get the open source norm that something like accessibility should be opt-in, particularly with UI toolkits and the like, but eh.)
I used plain gtk-rs for my last project and there is definitely some friction between rust and the gobject system. I think for my next project I will give relm4 a try. Apparently you can always drop back to gtk-rs if needed.
Interesting - If you're after cross platform Flutter/Dart seems a more cross platform solution (mobile, desktop and web), or Delphi/Lazarus without the web.
Sure. But you're stuck with GTK on every platform. "Cross platform, so long as you want to use GTK everywhere" is much less exciting than using actual native cross-platform UI elements.
You have to head to the documentation to see an example. It is still Rust, which is a bit of an acquired taste so keeping that beauty off the main page makes sense.
Last time I've looked at Relm4 it was in the middle of global refactoring that required changes to all codebases. Is it stable(-r) now?
Also what is this cross-platform you speak of, if we're talking about Gtk4? Compiling glib on Windows doesn't sound very cross-platform to me. Heck, Gtk4 doesn't sound very cross-platform if we're thinking about anything that's not Gnome.
> Built on GTK[...]
If it's built on GTK, it's not "truly native" on anything but Linux (and with the lack of accessibility to boot). If you're not crafting your own NSButtons and such, you are nowhere near "truly native".
1. Use a native widget system such as GTK (I evaluated Qt too)
2. Wrap widgets into a component datatype that is aware on how to update the widget when the props/model changes.
3. Define a dispatch closure that is passed to widget that accepts messages. Actions on the widgets should use this instead of mutating a reference.
4. That dispatch closure is component aware and it will call the update function on all the widgets.
There are some extra complications for long running computations but the model is a good base to build on. I wish the best to the relm team, most likely I will use them when programminmg in rust.
- Electron and friends (web toolkits, tauri, etc)
- Or my favorite: Just have a UI library which wraps all the native UI toolkits on each platform. Eg: https://daybrite.dev/
So, not native in the sense of using or even resembling the native UI toolkit.
https://docs.gtk.org/gtk4/visual_index.html
https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/wid...
Also what is this cross-platform you speak of, if we're talking about Gtk4? Compiling glib on Windows doesn't sound very cross-platform to me. Heck, Gtk4 doesn't sound very cross-platform if we're thinking about anything that's not Gnome.