I investigated egui early this year. It's a very good library! For me, getting used to immediate mode UI was a change from being used to DOM / React-style UI. imgui works well for a lot but it struggles with complex layouts, eg flexbox. This is acknowledged in egui's README
Could you possible share the source to your two examples? I'd love to see how much is accidental complexity vs actual complexity, compared to how web UIs (and other similar paradigms) can be built almost in an almost fully declarative way.
Why does every IM UI library have a dropdown widget that they call "Combo box"? Dear IMGUI, Nuklear, this one does it too.
A dropdown list is not a combo box - a combo box is a text input box combined with a dropdown list. This "combo" aspect is missing in all these frameworks, but they still call their simple dropdowns "Combo box".
I use this in a few of my projects. Simple, no complaints. Compile time is faster than it takes for me to yawn most of the time (using mold linker and sccache, which improves compile time a lot with a far superior linker and caching compiled dependencies, respectively).
(Edit to add: below complaint is entirely within rust and irrelevant to this library)
Only problem (not the fault of egui) is sometimes the elements disallow me using the templateapp object mutably as a whole: sometimes I have to mut borrow a part of `self` before the ui part (instead of mutating `self.whatever` within the UI element, I have to do `let borrow = self.whatever.borrow_mut()` before the UI element then call that borrow) which seemed odd to me as a beginner. I think this is mostly a rust "problem" but also maybe because of how UI element creation was designed.
If you understand the borrow rules then you'll probably understand it fine. I might be able to just lock an Arc Mutex instead and avoid the problem but I just learned how to use them so :p
The awkwardness is because use of `self.whatever` in closures borrows `self` as a whole instead of just the `whatever` part. The good news is that Rust is going to fix this soon:
Reminds of highly interactive older Windows programs, like Photoshop. Every slight mouse movement gives you some sort of feedback, every click makes a change, everything is snappy... I like those things and I'm sad the web took them away. On the web everything is dull and dead, you can tell it very much was designed for reading.
As of a recent release, egui pushes out some events that I'm able to consume and provide TTS feedback for. You can find a simple Bevy example with a bit of event coverage here:
In my game, I'm able to use this for buttons, checkboxes, and single-line text edit fields. Sliders are a bit wonky but I'm hoping to eventually get those working better as well. Much of this development is needs-driven for me, and as of now I only need these few widgets. I certainly wouldn't complain if coverage improved, though. :)
Before anyone jumps on me about screen readers not being the accessibility end game, I do know that. But as a totally blind developer myself, I can't easily work on solutions for low vision, high contrast, etc. And for my needs (simple keyboard navigable game UIs for games targeted at blind players) it works well enough, and should hopefully get better soon.
For true cross-platform accessibility with integrations into native APIs, we'll need something like https://accesskit.dev.
Yeah, I believe accessibility is not addressed at all. Similarly when compiler for web, it would be great if the UI would actually behave as text (actual web page) and could be copied into the clipboard etc.
Why is everyone concern with accessability on small gui tool? Someone make a cool project and always hackernews with the question on how it serve this very small demographic.
Looks pretty nice apart from the font rendering, which is terrible. It looks half decent with the default color scheme but when you switch to the dark mode it really shows.
I'm using a regular 1920x1080 27" display for reference
One of the best things that Egui does is updating the layout using a reactive rendering strategy by default. So rather than doing a paint per frame (each 15ms), it does it lazily only when the state changes.
For example: if you have a plot that updates each 10ms... a UI paint will be triggered each 16ms (up to 60fps I believe). If not, the UI will be updated lazily (when you move the mouse or other event happens).
Note: you can choose a "continuous" rendering mode for the backend as well.
It also has great accessibility with a built-in screen reader.
It's an impressive piece of work.
I see many complaints about the font rendering and I also agree the fonts don’t look good. This is a general problem with OpenGL. OpenGL draws triangles. There is no support for antialiased text rendering. And if one can figure out how to render live text with OpenGL, it won’t be something a GPU is efficient at rendering. I think the normal approach is to pre-render all needed glyphs and then move them into position. Pathfinder, Slug, and the work from Raph Levien are the only projects I know working on GPU based font rendering.
I'm imagining some way of bridging the VST3 API's and the WAM API's, so that you could write code using "eframe" that would run either as a natively compiled VST plugin, or in a browser and using the DOM audio API's as a Web Audio Module.
native -- glium (OpenGL) -- --- VST3/LV2 API "Adapters"
/ \ /
eframe --- Generic Audio/Synth/FX API's
\ / \
web ----- WASM (WebGL)----- --- Web Audio Modules API "Adapter"
Wouldn't something like that just be really friggin cool?
I'm not big-brain enough to figure out the details or if it's even viable, but damn it would be revolutionary.
Figuring this stuff out is mostly grunt work, see if you can get a minimally viable prototype going, then maybe you can attract some big brains to refactor and improve and make it into something.
I'm using it for some of my little tools, and it's pretty seamless going between native and web, which I appreciate a lot, and unlike other non-native UI frameworks, navigating through egui feels pretty natural (the way input are handled etc).
I've always enjoyed making little apps with Immediate mode GUIs. It's a shame that they aren't as effective as retained GUIs for more complex apps.
When I was still programming in Rust FLTK was the only GUI I used that both worked on my Raspberry Pi 4 and was something I felt like I could grasp. I'm not sure if that is retained or immediate or not. I wish the OS maintainers would all get their act together and create an api that made creating cross platform GUIs easier. You can't blame people for using Electron when you see the state of desktop GUIs
It’s, from my experience, the sanest of all toolkits - much easier and simpler to use than almost any other, for 98% of tasks, and usually faster. Back in 1998(!) when I started using it, it was also the only flicker free one for Windows and X (without very significant effort) although I believe that gap was finally closed circa 2008 or so.
The plot widget is pretty nice. Makes me wonder if it could be an interesting frontend for viewing data in Python, like a realtime-capable, GPU-driven, web-friendly matplotlib.
One thing I wish every immediate mode GUI library would show is how it handles complex script like Thai, Arabic, etc. because it's quite hard to get it correct, but it's also the hard requirement if your application need to support those language.
I took a look at the GitHub repo and I understand this is a GUI library for Rust, but I don't quite understand what they mean by "immediate mode" - could someone elaborate on that, please? Thank you!
Immediate mode guis, afaik started in games. The GUI is written on every frame of the game, layout and state (i.e. button presses) are handled in code.
This looks like a good excuse / starting point to learn Rust, but available documentation is basically tutorials that are hard to follow without knowing Rust. (I did work through Rustlings but mostly forgot it).
Of course, it's unfair to ask of any library to provide an intro that also presents the surrounding language. But Rusteros are always so eager to gain converts so... hey, here's a tip.
[+] [-] paulshen|4 years ago|reply
Couple things I built with egui: https://artifacts.bypaulshen.com/rust-gui/code-render/ https://artifacts.bypaulshen.com/rust-gui/tictactoe/
[+] [-] capableweb|4 years ago|reply
[+] [-] unknown|4 years ago|reply
[deleted]
[+] [-] fluidcruft|4 years ago|reply
[+] [-] soheil|4 years ago|reply
[+] [-] ducktective|4 years ago|reply
https://emilk.github.io/egui/index.html
[+] [-] elpocko|4 years ago|reply
A dropdown list is not a combo box - a combo box is a text input box combined with a dropdown list. This "combo" aspect is missing in all these frameworks, but they still call their simple dropdowns "Combo box".
[+] [-] athorax|4 years ago|reply
[+] [-] mastax|4 years ago|reply
> This is because WebGL does not support linear framebuffer blending (not even WebGL 2!).
> Maybe when WebGL3 becomes mainstream in 2030 the web can finally get colors right?
Yes, I had to transcribe this manually because I couldn't copy and paste it.
[+] [-] micheljansen|4 years ago|reply
[+] [-] Rd6n6|4 years ago|reply
[+] [-] dleslie|4 years ago|reply
[+] [-] theiasson|4 years ago|reply
[+] [-] sodality2|4 years ago|reply
(Edit to add: below complaint is entirely within rust and irrelevant to this library)
Only problem (not the fault of egui) is sometimes the elements disallow me using the templateapp object mutably as a whole: sometimes I have to mut borrow a part of `self` before the ui part (instead of mutating `self.whatever` within the UI element, I have to do `let borrow = self.whatever.borrow_mut()` before the UI element then call that borrow) which seemed odd to me as a beginner. I think this is mostly a rust "problem" but also maybe because of how UI element creation was designed.
If you understand the borrow rules then you'll probably understand it fine. I might be able to just lock an Arc Mutex instead and avoid the problem but I just learned how to use them so :p
[+] [-] pornel|4 years ago|reply
https://blog.rust-lang.org/2021/05/11/edition-2021.html#disj...
[+] [-] soheil|4 years ago|reply
[+] [-] dleslie|4 years ago|reply
Looking at the custom widget example didn't leave me with the impression that it has that in mind, but I could be mistaken.
[+] [-] ndarilek|4 years ago|reply
As of a recent release, egui pushes out some events that I'm able to consume and provide TTS feedback for. You can find a simple Bevy example with a bit of event coverage here:
https://github.com/ndarilek/bevy_egui_a11y
In my game, I'm able to use this for buttons, checkboxes, and single-line text edit fields. Sliders are a bit wonky but I'm hoping to eventually get those working better as well. Much of this development is needs-driven for me, and as of now I only need these few widgets. I certainly wouldn't complain if coverage improved, though. :)
Before anyone jumps on me about screen readers not being the accessibility end game, I do know that. But as a totally blind developer myself, I can't easily work on solutions for low vision, high contrast, etc. And for my needs (simple keyboard navigable game UIs for games targeted at blind players) it works well enough, and should hopefully get better soon.
For true cross-platform accessibility with integrations into native APIs, we'll need something like https://accesskit.dev.
[+] [-] mastax|4 years ago|reply
[+] [-] 4fips|4 years ago|reply
[+] [-] da_big_ghey|4 years ago|reply
[+] [-] no_time|4 years ago|reply
I'm using a regular 1920x1080 27" display for reference
EDIT: the unhinted editor font looks good.
[+] [-] sodality2|4 years ago|reply
[+] [-] syrusakbary|4 years ago|reply
One of the best things that Egui does is updating the layout using a reactive rendering strategy by default. So rather than doing a paint per frame (each 15ms), it does it lazily only when the state changes.
For example: if you have a plot that updates each 10ms... a UI paint will be triggered each 16ms (up to 60fps I believe). If not, the UI will be updated lazily (when you move the mouse or other event happens).
Note: you can choose a "continuous" rendering mode for the backend as well.
It also has great accessibility with a built-in screen reader. It's an impressive piece of work.
[+] [-] andrewmcwatters|4 years ago|reply
Here’s an example of a standard GUI invalidation event: https://github.com/Planimeter/grid-sdk/blob/master/engine/cl...
As you mentioned, most GUI software invalidates primarily on mouseovers, and individual components handle things like invalidation on focus.
[+] [-] jbritton|4 years ago|reply
[+] [-] gavinray|4 years ago|reply
- This has a framework "eframe" which lets you write generic apps which can be rendered and run either natively on on the web with WASM:
This has me thinking -- there's an existing standard "Web Audio Modules (WAM)" which never really went anywhere:https://www.webaudiomodules.org/
I'm imagining some way of bridging the VST3 API's and the WAM API's, so that you could write code using "eframe" that would run either as a natively compiled VST plugin, or in a browser and using the DOM audio API's as a Web Audio Module.
Wouldn't something like that just be really friggin cool?I'm not big-brain enough to figure out the details or if it's even viable, but damn it would be revolutionary.
[+] [-] gameswithgo|4 years ago|reply
[+] [-] soheil|4 years ago|reply
iOS-style toggle switch:
[+] [-] freemint|4 years ago|reply
[+] [-] 4fips|4 years ago|reply
[+] [-] Decabytes|4 years ago|reply
When I was still programming in Rust FLTK was the only GUI I used that both worked on my Raspberry Pi 4 and was something I felt like I could grasp. I'm not sure if that is retained or immediate or not. I wish the OS maintainers would all get their act together and create an api that made creating cross platform GUIs easier. You can't blame people for using Electron when you see the state of desktop GUIs
1. https://github.com/fltk/fltk
[+] [-] beagle3|4 years ago|reply
It’s, from my experience, the sanest of all toolkits - much easier and simpler to use than almost any other, for 98% of tasks, and usually faster. Back in 1998(!) when I started using it, it was also the only flicker free one for Windows and X (without very significant effort) although I believe that gap was finally closed circa 2008 or so.
[+] [-] DennisP|4 years ago|reply
[+] [-] radarsat1|4 years ago|reply
[+] [-] mahoho|4 years ago|reply
[+] [-] lioeters|4 years ago|reply
https://ejje.weblio.jp/content/えぐい
[+] [-] innocenat|4 years ago|reply
[+] [-] darknavi|4 years ago|reply
1: https://github.com/ocornut/imgui
[+] [-] MrWiffles|4 years ago|reply
[+] [-] otoburb|4 years ago|reply
I also read an old 2005 blog post & video by Casey Muratori[1] that explains the differences in more detail.
[1] https://caseymuratori.com/blog_0001
[+] [-] accountofme|4 years ago|reply
[+] [-] unknown|4 years ago|reply
[deleted]
[+] [-] unknown|4 years ago|reply
[deleted]
[+] [-] prionassembly|4 years ago|reply
Of course, it's unfair to ask of any library to provide an intro that also presents the surrounding language. But Rusteros are always so eager to gain converts so... hey, here's a tip.