Live data from Hacker News

GUI development with Rust and GTK 4

gtk-rs.org

31–40 of 172 posts

Re: GUI development with Rust and GTK 4

#31

Earlier quoted context omitted.

You wonder based on what? Static will put something in the binary itself and it will be memory mapped in, which won't even need to be directly allocated.

The apostrophe isn’t superfluous. ‘Static in this context refers to static lifetime. Lifetimes have absolutely 0 impact on runtime.

How would you get a static lifetime without a static object?

Re: GUI development with Rust and GTK 4

#32
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.

Agree with egui, although it is missing some widgets, they’re easy enough to build. But the real killer feature for me is that it’s cross platform including the web. Write once and compile to windows/Mac/Linux/web is finally here through Rust and egui.

Re: GUI development with Rust and GTK 4

#33

Earlier quoted context omitted.

You wonder based on what? Static will put something in the binary itself and it will be memory mapped in, which won't even need to be directly allocated.

The apostrophe isn’t superfluous. ‘Static in this context refers to static lifetime. Lifetimes have absolutely 0 impact on runtime.

I'm not sure what this has to do with the parent post or how it contradicts what I said.

https://doc.rust-lang.org/std/keyword.static.html

Re: GUI development with Rust and GTK 4

#34
post #9

Rust GTK4 "hello world" app, as a downloadable project, demonstrating the builder pattern: https://github.com/SixArm/rust-guideposts/blob/main/projects...

Honestly this looks like programming style from 90s. Why not design UIs in an editor that saves layout to XML?

Re: GUI development with Rust and GTK 4

#35
post #14

Earlier quoted context omitted.

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 t…

Native look and feel is vastly overrated imo. Delphi and before it borland builder made for great UIs despite not looking native. To the point that when I came across that widget set, I knew I was in for a good UX. Still many bespoke interfaces, like at a brakes repair or small lumber yard chain use delphi and it works just fine. As for the webview, thats a thing, but if you will have web access, you can target wasm,…

I mean no offense to the egui people because they have done amazing work, but it isn't that it isn't native, it is that it doesn't look good enough to ship something with it (other than a science/medical/gaming UI perhaps, but certainly not a business app). Gtk won't look native either on anything but Linux...at all, but at least is very professional looking in its default theme. Obviously what looks "good enough" is highly subjective.

UPDATE: True, it is themable, I just wish the default was a little more polished

Re: GUI development with Rust and GTK 4

#36
post #35

Earlier quoted context omitted.

Native look and feel is vastly overrated imo. Delphi and before it borland builder made for great UIs despite not looking native. To the point that when I came across that widget set, I knew I was in for a good UX. Still many bespoke interfaces, like at a brakes repair or small lumber yard chain use delphi and it works just fine. As for the webview, thats a thing, but if you will have web access, you can target wasm,…

I mean no offense to the egui people because they have done amazing work, but it isn't that it isn't native, it is that it doesn't look good enough to ship something with it (other than a science/medical/gaming UI perhaps, but certainly not a business app). Gtk won't look native either on anything but Linux...at all, but at least is very professional looking in its default theme. Obviously what looks "good enough" is…

You can skin it fully though. I have an app that looks nothing like the default theme. Customize it to your taste.

Note: I did have to implement some missing features for my purpose, so when I say “fully” I mean I had to spend a couple hours putting the features I wanted together. But in the end, it was a great result. Maybe this work should be turned into a PR, I dunno.

Re: GUI development with Rust and GTK 4

#37
post #21

Earlier quoted context omitted.

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

I'm aware of those, but I don't consider those UI crates in the same way as gtk-rs. The best analogy I can come up with is I don't consider react or vue-js UI libraries either, but low level libraries that can be used to build a UI lib. I consider Material UI (which uses react) to be a UI lib, for example. In the same way, AFAIK these crates are much more concerned with inventing the best UI paradigm than they are at…

IMO they're just less mature than the one's you've listed. I'd expect them to get all the bells and whistles in due course (assuming that the projects suceed in general).

Re: GUI development with Rust and GTK 4

#39
post #14

Earlier quoted context omitted.

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 t…

Native look and feel is vastly overrated imo. Delphi and before it borland builder made for great UIs despite not looking native. To the point that when I came across that widget set, I knew I was in for a good UX. Still many bespoke interfaces, like at a brakes repair or small lumber yard chain use delphi and it works just fine. As for the webview, thats a thing, but if you will have web access, you can target wasm,…

I need very flexible charting. While egui has some basic stuff builtin, I need something closer to what imgui-charts has (which makes imgui-rs a candidate for me, but probably not egui). A webview would also work as a fallback with a JS charting lib, but egui can't do that either.

Re: GUI development with Rust and GTK 4

#40

At this rate programming languages will reinvent GUI builders from Delphi/Lazarus in 2050

I still find it quite sad that the pinnacle of GUI programming tools was reached over 20 years ago, when Delphi 6 was released, and we've been going more or less downhill ever since.
Post reply on HN