Live data from Hacker News

Egui – An immediate mode GUI written in Rust

egui.rs

131–140 of 143 posts

Re: Egui – An immediate mode GUI written in Rust

#131

Earlier quoted context omitted.

For Rust?

Yep!

Would be very interested in evaluating it now for some early feedback. Currently working on a CAD/CAM application and having to make some tough choices about multi platform native UI support. My email is in my profile if you want to reach out.

Re: Egui – An immediate mode GUI written in Rust

#133
post #98

Earlier quoted context omitted.

I think you can work around it by listening on the touchstart event on your element and calling e.preventDefault(). Don't have an iPhone handy to test it right now, but I believe that's how I fixed that issue in my web game.

Thank you for the suggestion. This is also what is discussed in some stackoverflow threads on that topic. I simply do not get why javascript is required to stop the browser from interfering with user actions. Calling preventDefault also messes with element focus and other events.

Yeah, I am not the biggest fan of iOS Safari because of things like these. In my case, disabling most default interactions was a desirable property because I wanted to handle all the UI myself - but I understand that may not always be a good solution.

Re: Egui – An immediate mode GUI written in Rust

#134

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

I ran into this recently in the emulator… it seems to be using a very half-baked OCR engine that can't even recognize default Android's default font correctly.

Re: Egui – An immediate mode GUI written in Rust

#135

Earlier quoted context omitted.

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…

On Android it more or less just uses the accessibility APIs to grab the actual text, you can do it without using Google Assistant even by selecting text inside an app's thumbnail window from the Recent Apps screen.

It doesn't. You can try running it when your keyboard is open and see what an absolute trainwreck the OCR makes of that.

Re: Egui – An immediate mode GUI written in Rust

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

In Rust, crates and not modules are the unit of compilation. Hot reloading is a whole other problem for the Rust ecosystem. You'd probably have to build it yourself or buy into a whole engine.

Re: Egui – An immediate mode GUI written in Rust

#137
post #60

I'm afraid that until browsers provide APIs to help render fonts with sub-pixel rendering (note: that would add fingerprinting bits), canvas-based UI rendering libraries will always have a big disadvantage (vs DOM-based) on all but the high pixel density devices. (This is well known by the egui authors, which is a great library!)

I'm not sure. Phones and Macs are already all high density enough. Apparently it's been removed on Mac. Probably not too long before even cheap windows laptops and Chromebooks have hidpi screens. Plus modern displays can have all sorts of weird subpixel layouts so it's not as simple as it used to be.

Hidpi monitors about about twice as expensive, and the only real advantage is that they look nicer. Maybe on a laptop that's a good use of $$$, especially if the screen is very small, but on desktop you'd almost always rather get a bigger monitor or a second monitor. So low DPI will be with us for a long time.

Re: Egui – An immediate mode GUI written in Rust

#138

Earlier quoted context omitted.

The poster above me explained to me that it's not like that?

Click the link, open the backend tab, and look where it says "Only running UI code when there are animations or input." Then you won't have to waste cycles deciding which random internet comment from a stranger to believe

If you set up "winit" so it only redraws on events, then you don't trigger an EGUI redraw very often. But if updates that affect the EGUI items are coming in from another source, like the network, you have to explicitly trigger a winit redraw cycle.

Don't know about web. Seems overkill if all you have are GUI widgets. Egui is most useful on top of something more graphical.

Scrolling text is a problem. EGUI isn't good at big text boxes with much offscreen text. That can be worked around.

Re: Egui – An immediate mode GUI written in Rust

#139

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?

[ https://truncate.town/](https://truncate.town/) is all egui (after the main menu)

Words fail me how much I love that game

Words similarly fail me how much I loathe and detest its GUI (at least on mobile browsers, where I often play the game). As an example, one has to actually _close_ the dictionary popup if you fat finger a letter because the fucking backspace doesn't work, or rather seems to require an incomprehensible number of presses to start deleting letters

Re: Egui – An immediate mode GUI written in Rust

#140

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?

https://rerun.io/viewer
Post reply on HN