Live data from Hacker News

Egui – An immediate mode GUI written in Rust

egui.rs

71–80 of 143 posts

Re: Egui – An immediate mode GUI written in Rust

#71
post #6

Demo pages like this are fun, and technically impressive when compiled to a browser environment. But I suffer from a lack of imagination so these widget demos don't really help me envision what an egui-powered app can do or might look like. Does anyone have any examples of fun things that use egui?

I use it in Sharpview. It's really for GUI programs, not web pages. It redraws everything on every frame, so it's most useful for 2D overlays on 3D game-type programs. For that, it's pretty good. It's one pass. As a result, layouts which are ordered left to right and top to bottom work well, but ones which displace or resize items above or to the left don't work well. Egui tries to fix things up on the next frame, th…

> It redraws everything on every frame, so it's most useful for 2D overlays on 3D game-type programs.

So it's not a GUI. In my book a GUI only redraws when something changes, to save the user's power.

Re: Egui – An immediate mode GUI written in Rust

#72
post #36

I have just used it yesterday to better understand a math problem and found that the edit-compile-run cycle of rust with this framework was prohibitively long. I only had a single file calling into this lib - maybe I could have improved on it with splitting the project up to some modules? Could anyone comment on their experience? Because usually I have found rust compile times okay, but this really made it hard to it…

Modules wouldn't fix this afaik.

I feel like hot-reloading would be the fix here, but I'm unsure what the state on that is.

Re: Egui – An immediate mode GUI written in Rust

#73

Am I the only one that has a problem with all non dom/html renderers that I can't copy the text on mobile? The same with flutter etc, it's such a regression in my eyes but nobody prioritizes it.

I summon Google Assistant and press the what's on my screen button, that one usually allows me to select text even when the apps don't.

The layers of extreme complexity in this situation are astounding.

The app has some text internally, it renders it by rasterizing fonts to a bitmap, the OS takes the bitmap and composites it within the wider UI. Google Assistant grabs a screenshot of the fully composited, post-processed OS UI, sends it over the internet to a server, which uses an OCR model to read all the text, and a different model to work out which is the relevant text, which is then sent back over the internet and displayed on the device.

All so the user can copy some text.

Re: Egui – An immediate mode GUI written in Rust

#74

Earlier quoted context omitted.

You generally can't copy text in native UIs unless the app author goes to extra effort to allow it. It's really the web that is the odd one out here because it was originally intended for documents.

> You generally can't copy text in native UIs You mean mobile apps, right? With desktop UIs this has traditionally never been an issue.

Never an issue in what sense? In my own experience, it's not been issue because there wasn't an expectation that this should be possible. For example, text in Tcl/Tk label widgets cannot be copied (at least not by default). There must be a way to extract text using an a11y interface, but I haven't encountered that in practice.

Re: Egui – An immediate mode GUI written in Rust

#75
post #5

Insanely snappy on mobile, very cool

On mobile I get > An error occurred during loading: > ReferenceError: WebAssembly is not defined > Make sure you use a modern browser with WebGL and WASM enabled.

WebAssembly isn't even a modern feature anymore, even iOS Safari (which traditionally drags its feet when it comes to web standard support) has WASM support since around 2017.

Re: Egui – An immediate mode GUI written in Rust

#76

Earlier quoted context omitted.

You generally can't copy text in native UIs unless the app author goes to extra effort to allow it. It's really the web that is the odd one out here because it was originally intended for documents.

> You generally can't copy text in native UIs You mean mobile apps, right? With desktop UIs this has traditionally never been an issue.

No, I mean with desktop UIs too. Try copying from a traditional win32 GUI or Qt or Gtk.

Re: Egui – An immediate mode GUI written in Rust

#77

Am I the only one that has a problem with all non dom/html renderers that I can't copy the text on mobile? The same with flutter etc, it's such a regression in my eyes but nobody prioritizes it.

I'm not sure about other smartphones but for the past years I've been using a godsend feature that allows me to copy any text in any app (including text on images). It's in the app switching mode in Android (or at least Pixels), the mode where you see your opened apps after pressing home for 1 second dragging up

Wow that is a very neat feature, thanks!

Re: Egui – An immediate mode GUI written in Rust

#78
post #61

Am I the only one that has a problem with all non dom/html renderers that I can't copy the text on mobile? The same with flutter etc, it's such a regression in my eyes but nobody prioritizes it.

This is trivial to do in Flutter if the developer wants to: https://api.flutter.dev/flutter/material/SelectableText-clas...

Yes but it's not the default like it is for the web, so most text is not selectable.

Re: Egui – An immediate mode GUI written in Rust

#79

Earlier quoted context omitted.

You generally can't copy text in native UIs unless the app author goes to extra effort to allow it. It's really the web that is the odd one out here because it was originally intended for documents.

> You generally can't copy text in native UIs You mean mobile apps, right? With desktop UIs this has traditionally never been an issue.

Desktop UIs only started adding that around 2000 or so (Gtk2?), it generally hadn't been possible before in the Windows/Linux world. Even today it still doesn't work as well as the Web, as the select ability is limited to a single widget, e.g. you can't copy&paste the complete text of the About box in Gimp in a single go and many other widget with text don't allow text selection at all.

That said, even on the Web it often feels like an afterthought. What text gets selected when you cross over multiple boxes in a layout often feels completely arbitrary, e.g. dragging the mouse to the left will select text at the top.

Re: Egui – An immediate mode GUI written in Rust

#80

Earlier quoted context omitted.

> You generally can't copy text in native UIs You mean mobile apps, right? With desktop UIs this has traditionally never been an issue.

No, I mean with desktop UIs too. Try copying from a traditional win32 GUI or Qt or Gtk.

Care to explain? All text editable widgets in Qt[1] supports text selection and copying.

[1] QTextEdit, QML TextEdit etc

Post reply on HN