Live data from Hacker News

GUI development with Rust and GTK 4

gtk-rs.org

81–90 of 172 posts

Re: GUI development with Rust and GTK 4

#82
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'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.

Re: GUI development with Rust and GTK 4

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

Agreed - I'm more and more thinking I'll just use Flutter and use gRPC to talk to a Rust backend. It has native looking widgets for each desktop OS (incl sidebars) if I want to go that way otherwise Material 3 is gorgeous IMO. Once they release the secondary window support I think it will be the best desktop UI framework on the market most likely...as it will look more like the new media centric UIs with nice animation, but with a lower resource usage.

(Yes, I know about the rust-dart-bridge or whatever, but gRPC gives my product an API at the same time for "free" and without the complexity of a multi-language project).

Re: GUI development with Rust and GTK 4

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

Having integrated C# and Rust recently[0], I have found that unlike Node w/ neon and Python w/ PyO3 + PyO3 Asyncio, there is no good Rust integration with .NET. Interopterus, rnet, etc leave a good bit to be desired.

I ended up writing all the unsafe bindings myself and used cbindgen on the Rust side to make a header and ClangSharpPInvokeGenerator to generate the C# binding. But you still have to manually handle ownership/freeing yourself, e.g. with SafeHandle. The ecosystem[1] could use something better, but nothing is there yet.

0 - https://github.com/temporalio/sdk-dotnet, specifically https://github.com/temporalio/sdk-dotnet/tree/main/src/Tempo...

1 - https://areweextendingyet.github.io/

Re: GUI development with Rust and GTK 4

#85
post #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.

Technically the pinnacle was around 2010.

Guess what happened around that time?

Firstly, the web won.

Secondly, mobile cemented the demise of the desktop.

Especially since mobile is horribly anti-crossplatform GUI toolkit, especially against open source toolkits.

Re: GUI development with Rust and GTK 4

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

[deleted]

Re: GUI development with Rust and GTK 4

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

Re: GUI development with Rust and GTK 4

#88

Earlier quoted context omitted.

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

Machine generated XML doesn’t play nice with version control for views that are even moderately complex. Merge conflicts become more of a nightmare to untangle as your app matures, plus it can make pull requests unintelligible. This is part of why for apple platform dev, several years ago I abandoned XML-based XIB and storyboard UI design for any collaborative project. Writing it all out in code (even with just UIKit…

> but Google is hellbent on the XML usage if you’re building with Android Framework

That said, folks rarely use the GUI editor for Android XML and managing merges isn't as painful, or really painful at all, when compared to XIBs/storyboards.

Also, as you mentioned, Jetpack Compose obviates that and every new Android view should use it IMO.

Re: GUI development with Rust and GTK 4

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

> 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

Re: GUI development with Rust and GTK 4

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

Exposing a C interface from rust is possible, but a bit of a pain.
Post reply on HN