Live data from Hacker News

GUI development with Rust and GTK 4

gtk-rs.org

111–120 of 172 posts

Re: GUI development with Rust and GTK 4

#111
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…

fltk-rs is mature and has a ton of features. Also, its license means that you can bundle it into a single binary without worrying about license contamination.

Re: GUI development with Rust and GTK 4

#112
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…

For me the litmus test is if it has a fully-featured listview or treeview, so you can do something like a file browser, a library app, or other kinds of data-heavy apps. Also important is that keyboard and mouse work as expected (tabbing, shift-selection, etc). Bonus if it supports the current "native" OS paradigms. E.g. on Mac: transparent sidebar, integrated titlebar, on Windows: MS office 2022 style simplified too…

Is there no Qt bindings for Rust yet?

Re: GUI development with Rust and GTK 4

#113
post #89

Earlier quoted context omitted.

For me the litmus test is if it has a fully-featured listview or treeview, so you can do something like a file browser, a library app, or other kinds of data-heavy apps. Also important is that keyboard and mouse work as expected (tabbing, shift-selection, etc). Bonus if it supports the current "native" OS paradigms. E.g. on Mac: transparent sidebar, integrated titlebar, on Windows: MS office 2022 style simplified too…

> Gtk doesn't look native anywhere but at least it has a very complete widget set and has been around for a while. It's being worked on. https://twitter.com/paulrouget2/status/1595357518913449992

That's a great start, much better than I would've expected, but padding definitely needs work. Modern macOS and iOS use more whitespace than prior versions but not nearly that much… the padding shown here should be cut down to maybe 25-50% of present values depending on the exact part.

Re: GUI development with Rust and GTK 4

#114
post #89

Earlier quoted context omitted.

> Gtk doesn't look native anywhere but at least it has a very complete widget set and has been around for a while. It's being worked on. https://twitter.com/paulrouget2/status/1595357518913449992

I’m curious about this, because over the past decade or so, large parts of GTK’s cross-platform ability have been actively sabotaged . It used to be possible to style it to look native on Windows, with some feel problems but mostly comparatively minor. Now, well, no one has quite managed native look (whether or not it’s possible, and certainly I’ll allow that “native” is very ill-defined on Windows these days), and f…

Unfortunately I agree with your analysis, I feel like GNOME is sabotaging not only the other platforms, but its own native one as well[1], to the detriment of the broader FOSS ecosystem. On the other end you have extreme minimalism like dwm, and the middle-ground like lxqt always felt lacking in polish.

What's the state of wxWidgets nowadays? I feel like they've always had the most honest approach to cross-platform support.

[1]: https://news.ycombinator.com/item?id=35650663#35653129

Re: GUI development with Rust and GTK 4

#115
post #57

What about making it easy to import Rust business logic into C# / Swift / whatever GUI language you're using? I get the value of 100% (or 50% or 80%) implementing the UI in Rust; especially for tools that won't benefit from a native UI, or tools that only need light integration into platform-specific UI features. I've also shipped a desktop product that had a 100% native UI and a cross-platform codebase. Today, imple…

It is really simple to call into native code from C# ( .NET ). While I have not done this with Rust specifically, presenting a C compatible interface from Rust should work fine.

In programming, never make an assumption that something is "easy."

https://news.ycombinator.com/item?id=35701181 did just that and explained the results.

Personally, I find PInvoke time consuming; and often time a lot of people screw it up.

I'm not sure how I'd translate things like lifetimes and ownership into C#: The language just doesn't have those concepts.

Lifetimes might make sense as IDisposable, but that could get tedious. I'd be tempted for types that are just "memory" to have finalizers.

Ownership may require some kind of locking wrapper.

Re: GUI development with Rust and GTK 4

#116
post #89

Earlier quoted context omitted.

For me the litmus test is if it has a fully-featured listview or treeview, so you can do something like a file browser, a library app, or other kinds of data-heavy apps. Also important is that keyboard and mouse work as expected (tabbing, shift-selection, etc). Bonus if it supports the current "native" OS paradigms. E.g. on Mac: transparent sidebar, integrated titlebar, on Windows: MS office 2022 style simplified too…

> Gtk doesn't look native anywhere but at least it has a very complete widget set and has been around for a while. It's being worked on. https://twitter.com/paulrouget2/status/1595357518913449992

Oh boy, that padding. Could park a lorry in between those list elements.

Re: GUI development with Rust and GTK 4

#117
post #82

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'm curious what people use that is missing, and what people find unsuited to commercial use. None of the text can be selected in the demo. imo that's a HUGE drawback.

You can only select and copy from text entry fields. Kind of weird for sure. And I can't figure out how to copy even then on mobile.

Re: GUI development with Rust and GTK 4

#118

Earlier quoted context omitted.

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

I've never seen the appeal of those "write your UI in a different language than the logic and deal with the interference layer" style of GUI development. But I also think that UI builders tend to produce bad code and ugly layouts when you go beyond CRUD apps that would have been easy to write in the declarative style anyway.

One argument I've heard for this model is that, by having the UI in a declarative language, the design team can update/experiment with the layout without having to understand the backing logic. I've only been on one team that actually subscribed to this model though.

Re: GUI development with Rust and GTK 4

#119
post #74
post #71

Earlier quoted context omitted.

xml is dated and gross

I really like XML a lot ; I've gotten large numbers of people to use XML & XSLT, where I work. XML is dated, and it is gross. Here's the two things the XML ecosystem nailed , which tie me to it: 1. A dedicated tree-based transformation language (XSL); and, 2. Axis-queries (Xpath). If I could Xpath all-the-things, I'd be a happier human. Although, I also feel like I should be able to SQL all-the-things, too. Maybe I'm…

XSLT is garbage tho.

Re: GUI development with Rust and GTK 4

#120
post #89

Earlier quoted context omitted.

> Gtk doesn't look native anywhere but at least it has a very complete widget set and has been around for a while. It's being worked on. https://twitter.com/paulrouget2/status/1595357518913449992

I’m curious about this, because over the past decade or so, large parts of GTK’s cross-platform ability have been actively sabotaged . It used to be possible to style it to look native on Windows, with some feel problems but mostly comparatively minor. Now, well, no one has quite managed native look (whether or not it’s possible, and certainly I’ll allow that “native” is very ill-defined on Windows these days), and f…

[deleted]
Post reply on HN