Live data from Hacker News

GUI development with Rust and GTK 4

gtk-rs.org

11–20 of 172 posts

Re: GUI development with Rust and GTK 4

#11
post #4

AFAIK, for better or worse, this is the only UI crate (other than HTML-like UI using something like Tauri) that provides a full set of widgets/capabilities on Rust. Every other UI lib is incomplete in some way or falls short for anything other than a toy or specialty type app in my experience. UPDATE: Things I have my eye on as they mature: Slint, egui, and iced. I'm especially watching iced as Pop_os is using it for…

I think egui is complete enough to use in real apps. Layout can be a bit weird, but I haven't found anything that's impossible.

I might even prefer it for cross-platform apps since startup time is so slow for GTK on Windows.

Re: GUI development with Rust and GTK 4

#13

What about relm4? Is it generally feature complete? Can one use relm4 for most things, and drop to gtk4 for the oddball task that is not supported? https://relm4.org/

Relm4 is actually based on gtk-rs, and you will be using gtk-rs widgets all the time.

I have to say however that despite heroic efforts by the authors, it doesn't really feel as nice as the "real" Elm architecture precisely because of the imperative focus of gtk-rs' API, the nature of Rust's memory management system, and depending on what you're doing you may feel forced far too often to drop from fantasy land to reap the benefits of the abstraction.

I'd still consider it next time I tackle a native app, but having tried Slint for writing simple UIs and having read some iced code, I think I'd only go for it if I'm really going for the Gtk native look and ecosystem.

Re: GUI development with Rust and GTK 4

#14
post #4

AFAIK, for better or worse, this is the only UI crate (other than HTML-like UI using something like Tauri) that provides a full set of widgets/capabilities on Rust. Every other UI lib is incomplete in some way or falls short for anything other than a toy or specialty type app in my experience. UPDATE: Things I have my eye on as they mature: Slint, egui, and iced. I'm especially watching iced as Pop_os is using it for…

I think egui is complete enough to use in real apps. Layout can be a bit weird, but I haven't found anything that's impossible. I might even prefer it for cross-platform apps since startup time is so slow for GTK on Windows.

The challenge with egui is the theme. It looks ok, but isn't good enough for a commercial business app for example. Also, I believe it lacks a webview, so if you are in a pinch the only thing you can do is create your own widgets without a way to cheat and embed some web content. I would agree for certain types of apps it may be "good enough" (science, gaming, medical perhaps...anything where the UI is secondary to the 3D viewport)

Re: GUI development with Rust and GTK 4

#15
post #4

AFAIK, for better or worse, this is the only UI crate (other than HTML-like UI using something like Tauri) that provides a full set of widgets/capabilities on Rust. Every other UI lib is incomplete in some way or falls short for anything other than a toy or specialty type app in my experience. UPDATE: Things I have my eye on as they mature: Slint, egui, and iced. I'm especially watching iced as Pop_os is using it for…

I have not looked, but are there no Qt bindings for rust? Qt is about as complete as they get.

Re: GUI development with Rust and GTK 4

#16
post #4

AFAIK, for better or worse, this is the only UI crate (other than HTML-like UI using something like Tauri) that provides a full set of widgets/capabilities on Rust. Every other UI lib is incomplete in some way or falls short for anything other than a toy or specialty type app in my experience. UPDATE: Things I have my eye on as they mature: Slint, egui, and iced. I'm especially watching iced as Pop_os is using it for…

I think egui is complete enough to use in real apps. Layout can be a bit weird, but I haven't found anything that's impossible. I might even prefer it for cross-platform apps since startup time is so slow for GTK on Windows.

Concur. I've been using egui for interactive chemistry visualizations, and PC software that interacts with embedded devices to configure them, view system status etc. It's easy-to-use, integrates with 3D graphics easily, and is fast.

Re: GUI development with Rust and GTK 4

#17
post #4

AFAIK, for better or worse, this is the only UI crate (other than HTML-like UI using something like Tauri) that provides a full set of widgets/capabilities on Rust. Every other UI lib is incomplete in some way or falls short for anything other than a toy or specialty type app in my experience. UPDATE: Things I have my eye on as they mature: Slint, egui, and iced. I'm especially watching iced as Pop_os is using it for…

I have not looked, but are there no Qt bindings for rust? Qt is about as complete as they get.

There are but they are not well maintained in general. Some of the bindings require some additional C++ or other painful ways of interop. I have heard some good things about the qmetaobject crate though.

Re: GUI development with Rust and GTK 4

#18
post #4

AFAIK, for better or worse, this is the only UI crate (other than HTML-like UI using something like Tauri) that provides a full set of widgets/capabilities on Rust. Every other UI lib is incomplete in some way or falls short for anything other than a toy or specialty type app in my experience. UPDATE: Things I have my eye on as they mature: Slint, egui, and iced. I'm especially watching iced as Pop_os is using it for…

I would add the following to your list:

- Vizia https://github.com/vizia/vizia

- Freya https://github.com/marc2332/freya

- Xilem https://github.com/linebender/xilem

- Floem https://github.com/lapce/floem

Re: GUI development with Rust and GTK 4

#19
post #10
post #7

Earlier quoted context omitted.

There are plenty of situations where GTK might be better than Slint, but not so overwhelmingly that I'd call it only for toy apps.

While you can create one on your own, any lib that doesn't have a tree widget isn't ready for primetime IMO. Obviously others may have a different opinion. Also, I don't believe there is any way to embed a webview at this point which is often necessary to embed things like charts or other widgets you don't want to create on your own.

GUI toolkits are like MS Word... as the saying goes, everybody only uses 10% but everyone uses a different 10%. This is one of the major things that makes it so hard to have a truly world-class widget set. Making "a" widget set is easy. Making a great one is staggeringly enormous.

Re: GUI development with Rust and GTK 4

#20
post #4

AFAIK, for better or worse, this is the only UI crate (other than HTML-like UI using something like Tauri) that provides a full set of widgets/capabilities on Rust. Every other UI lib is incomplete in some way or falls short for anything other than a toy or specialty type app in my experience. UPDATE: Things I have my eye on as they mature: Slint, egui, and iced. I'm especially watching iced as Pop_os is using it for…

Might be worth adding a "complete widget" flag to areweguiyet.com but I'm fairly sure that's just an invitation to bickering about the definition of "complete" :P
Post reply on HN