Are there any similar libraries to egui except it is retained graphics?

So I have made an application in gtk-rs however I am not a huge fan of use of callbacks and syntax wise (e.g. checkboxes cannot directly write to a &mut bool or singleline edit/entry fields cannot write to &mut String), I prefer to use something similar syntax to egui except it is retained.

Are there any libraries that are:

  • Written in pure Rust
  • Similar to egui syntax but retained
  • Uses gtk theme support
  • Its a library not a framework as defined by ratatui:

what do you mean by "similar"? in what sense is it similar "in syntax"? can you elaborate more? does xilem fit your definition of "similar"?

As already mentioned:

Will look into this thanks

Egui can provide what it does (no callbacks, widgets directly modifying &mut references, and in general UI as code) because it reruns your code every times there are updates, that is because it is not retained.

1 Like

oh, so that's what you mean by "syntax", I thought the word "syntax" was refering to some kind of DSL, or something the like.

but what you described is unique to immediate mode, as @SkiFire13 points out, you cannot do that in retained mode, that's the definition of retained mode:

the states (the boolean indicating a checkbox being checked, the string represents the content of a line edit, etc) are "retained", or in other words, "owned", by the GUI widgets tree, not by the application. and you must synchronize the application states and the "retained" GUI states in response of various "events".

so, my next question is, what's your motivation to seek for a "retained" mode library, instead of just using egui? maybe you are asking a wrong question (a.k.a. an XY problem), and "retained mode" is not the solution for the real problem?

or put it in another way, what's the problem that stops you from using egui in the first place?

I think there has not changed much since you asked in October 2024:

Is there a similar gui library to egui but it is retained?

3 Likes

egui doesn't use gtk themes one huge downside of egui vs gtk-rs but anyways thanks for the info.

I thought I asked way longer before. anyways thanks