this post was submitted on 30 Sep 2023
109 points (91.0% liked)

Programming

17000 readers
253 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 16 points 11 months ago (4 children)

For desktop UI: Rust

Okay, what crate do you use for UI, that it is your goto?

[–] [email protected] 3 points 11 months ago

I have used egui in two projects now. It's super easy to write, but the immediate mode does put some limitations on what you can do.

Iced seems to be pretty good as well, but having to put every single user interaction into a message enum sounds tedious.

[–] onlinepersona 3 points 11 months ago (1 children)

I use slint. You can also use the rust bindings to GTK. There are a list of Rust GUI libs/frameworks at https://areweguiyet.com/

It allows compiling to WASM too and being embedded in websites, but I haven't had time to figure that out yet.

[–] [email protected] 3 points 11 months ago (1 children)

How do you like the language to define the layout?

I'm always wary of DSLs.

[–] onlinepersona 2 points 11 months ago (1 children)

It's quite alright and I find it intuitive. For my needs, simple, fast UIs with async support, it's perfectly alright.

The biggest problem I have is creating completely new UI elements (or components, as they are called in slint) from scratch. You can combine elements and make new ones, but if you want to create something completely new for example some new animation, or render graphs, or something, you're going to have a bad time.

[–] [email protected] 2 points 11 months ago

Thanks for your impression.

I've used egui twice now and there creation of custom components is easy and encouraged. I adapted a drop down menu to better suit my needs (typed input get highlighted in the available options) and it was easy to do so.