In search for GUI library

Hi! I'm in search for GUI library which will satisfy following needs

  • Portable
  • Has ability to to do low level graphics such as spectrum chart, signal graph, spectrum waterfall.
  • Highly Desirable but optional (of no other options) - menu system.

I really liked relm but it is based on GTK which has graphics limited to what cairo can do and cairo is vector graphics library and cannot manipulate pixels.

I looked at conrod but also cannot find pixel manipulation as well as menu system. I know you can probably do fancy stuff with opengl but that sounds like overkill and extra level of complexity and dependency (which will compromise portability).

Any ideas what else i can evaluate, preferably not a dead project?

1 Like

For pixel-level 2D graphics in GUIs, I think your best bet these days is to separate the generation of a bitmap (which can be handled via anything from SDL or ImageMagick to OpenGL depending on your requirements) from the action of displaying said bitmap (which can be handled using an "OpenGL view" (don't remember the name) or GtkImage widget which does nothing but forwarding the output of the bitmap generation code).

The reason being that modern GUI toolkits are heavily skewed towards doing everything using OpenGL and vector graphics libraries. The "just give me an array of pixels" path still exists (e.g. GdkPixbuf), but is deprecated and on its way to removal.

1 Like

I use Gtk in my fractal renderer, which of course handles pixels. The code is a bit ugly (and rather old), but it works. Feel free to take a look at GitHub - kaj/kratsfract_rust: Rendering fractals in Rust language .


Thanks for the example, but I'm a bit concern that it has no future due to gdk pixbiuf being deprecated (after reading of Hadrien's comment.) GDK warnings say that you should do rendering via rectangle/fill (which is kinda lame). Also i'm not sure what gtk/gdk version is needed for it to compile correctly, it does not work with the latest stuff.

Eh ... I did update and test before writing that comment earlier today, but updating again now it is indeed broken. Apparently lots of new gtk/gdk/cairo stuff was released just now?

I'll see if I can get running again with updated dependencies.

Wohoo, it works now.

Yep, the required changes was easy. The way I draw pixels is as ugly as it was before, but now it works again ... :slight_smile: