Settings

Theme

IUP – Cross platform C GUI library

tecgraf.puc-rio.br

110 points by inxode 3 years ago · 41 comments

Reader

unwind 3 years ago

This seems to be like the classic wxWidgets [1], i.e. it's an API that wraps the underlying platform's default toolkit. So on Windows it uses Windows' native controls, in Linux it seems to use GTK, and so on.

That means that the advantage is being able to write against one API, and get cross-platform compatibility, which can be nice. It also means (typically) being limited in what you can do to the least common denominator, or you (=the toolkit author) end up having to re-implement features from one platform that you want to expose but that are missing on some supported target(s). Or, of course, have an API with non-portable parts in it.

In any case, it means the "look and feel" is not the core feature of the API since that is going to be "like the target platform" and that is the point.

Given the origin, I guess Lua support is important too, here.

[1]: https://www.wxwidgets.org/

  • tored 3 years ago

    One big plus for IUP over wxWidgets is that API of IUP is very clean & easy to use compared to the complex C++ API of wxWidgets.

    • rhdunn 3 years ago

      wxWidgets feels heavily inspired by Microsoft's MFC framework. That always felt clunky to me, compared to GUI toolkits like Qt and GTK.

      • VZ 3 years ago

        This was indeed the case. In 1995. Since then just about everything has changed, but the idea that wxWidgets is MFC-like still refuses to die... Another common related opinion is that you have to use macros when using wxWidgets, which couldn't be further from truth since ~15 years (see https://wxwidgets.org/blog/2023/05/are-macros-required-to-us...) but, again, old impressions linger.

        • rhdunn 3 years ago

          Macros aren't the only thing that make wxWidgets like MFC. Things like using new but not delete on objects. The method and event names. The use of DCs in paint events. Etc.

          • VZ 3 years ago

            Well, there is only so much latitude for naming the event (or message, callback, whatever) sent when a window needs to repaint itself. Qt has `paintEvent()` too and nobody calls it MFC-like AFAIK. IME people mostly think about event table macros when they say it.

        • sirwhinesalot 3 years ago

          I still find examples using the macros all over the place. It is unfortunate that is still the case...

  • antihero 3 years ago

    Thing is, each OS has its own design language and conventions. Trying to make one UI look and feel great in all of them is doomed to fail and feel awkward in all of them.

    So either make a UI for each OS or go your own way and have your own design language.

  • kaba0 3 years ago

    What’s people’s opinion on Eclipse’s SWT? It is probably the most commonly used API that just wraps native controls.

gen2brain 3 years ago

IUP is very nice and easy to use, and it uses real native controls, which is a big plus. Compared to wxWidgets, being written in C, it is easy to create bindings. I maintain Go bindings for IUP core here https://github.com/gen2brain/iup-go.

I wish development is faster though, perhaps moving the project to GitHub could help with that. I would like to see modern tray support on Linux instead of legacy one, someone to finish Cocoa support, native table/list view control (it is on the TODO list), support for gtk+ 4, etc.

diego_moita 3 years ago

It still has no support for OS-X.

I can understand the reason.

This library is made by Brazilian researchers working for an institute (very poorly) funded by the government. However, Apple machines are very, very expensive in Brazil and many other 3rd World countries, almost a luxury. Probably they're not affordable enough to many of those researchers.

However, not having a OS-X version is really a big obstacle for this library to be accepted.

  • MisterTea 3 years ago

    I know a young programmer in Brazil who is running Linux on a 2000's laptop simply because they cant afford anything better. At the time I was ignorant of their import taxes and said I had a spare motherboard/cpu/ram combo and a laptop I could send them and they politely refused my offer stating they would go broke paying the import taxes. Sad situation.

  • PTOB 3 years ago

    Same problem in the USA with those Apple machines.

torstenvl 3 years ago

I love the idea, and considered using this for a side project, but ultimately went a different route.

The biggest issue for me was the somewhat constrained idea of "cross platform" it's working with. There was an attempt at a Cocoa port, but it seems even less active than the main project. https://github.com/ewmailing/IupCocoa

Ultimately, I decided that a careful addition of a minimal amount of C++ code to use wxWidgets was less kludgey than using a half-baked Cocoa port or coaxing IUP GTK to work with Mac GTK. I've been mostly happy with that decision.

marcodiego 3 years ago

One of my advisors studied at puc-rio. Until early 2000's they had contacts with Petrobras (giant Brazilian oil and gas company) and SGI. We had some beautiful, exotic and powerful Silicon Graphics workstations in our labs: O2's, Fuel, 230... And people developed some impressive UI's like the ones available in the tecgraf section of https://www.tecgraf.puc-rio.br/iup/en/screenshots.html .

Also there was some pressure for us to use IUP. We always had a "not as maintained as gtk or qt" feel and as much as we could, we refused it. I think nobody regrets that.

jonathanstrange 3 years ago

IUP has been around for ages and is usually used as a lightweight alternative to wxWidgets and Qt when you want native widgets. It has a stringy interface and the fully stylable non-native widgets starting with "Flat" in the name are a bit quirky, but it's overall very stable and has proved its usefulness over time. IUP often has bindings to languages when wxWidgets has not and Qt would be too bloated.

tored 3 years ago

IUP is well designed, source code is clean and easy to read and it is easy to create bindings for it.

No overusing of weird macros, no large structs to define (IUP uses void pointers) or other C-isms that can be hard to translate over language barriers.

I tested to write bindings for PHP over FFI and it was trivial.

Main drawback is that the Mac support is experimental.

Reticularas 3 years ago

It appears to be a requirement that all C/C++ UI libraries have old, crusty looking visuals.

  • wahern 3 years ago

    It uses native GUI widgets. Some of those screenshots are ancient. But also it only binds a least common denominator subset of widgets, so applications will lack many of the niche widgets and layouts that platform-native applications often use to keep a fresh look & feel.

  • speed_spread 3 years ago

    It's about time we rediscovered 3D UI like SGI IRIX had 30 years ago and remix it with what we've learned in information presentation since. WebGPU? I want my cyberspace and I want it now!

    https://en.wikipedia.org/wiki/Fsn_(file_manager)

  • sirwhinesalot 3 years ago

    That's mostly due to them wrapping native widgets. They couldn't have known windows would effectively stop updating Win32 and reinvent the wheel like 5 times.

    This sort of toolkit tends to look ok on macOS where that degree of insanity didn't happen.

  • tabtab 3 years ago

    "Old" isn't necessarily bad. If you want productivity over fashion, older styles are often better. They are more mouse-friendly and easier to understand, as buttons actually look like buttons instead of faded flat stickers.

  • scythe 3 years ago

    The toolkit itself is at least twelve years old, so there's that.

begriffs 3 years ago

I've been meaning to give Motif a try for cross-platform C GUIs. Can anyone share their perspective with that, and compare with IUP?

tabtab 3 years ago

How does this compare to GTK in terms of features?

Maybe somebody can use it to make the state-ful GUI browser that the "office" industry sorely needs so we don't have to force DOM to act like a real GUI (which it does painfully and poorly). GUI's and mice do most the real work; let's not give all the standards attention to web toys and mobile.

bruce343434 3 years ago

PUC RIO keeps winning. Among other victories is the language Lua.

syngrog66 3 years ago

ah, yet another "cross-platform GUI lib". I've lost track of how many have been created by now, briefly became popular then accumulated warts or got abandoned. any day now we'll solve it for sure this time. haha :-)

kids, get off my lawn

(doing curses work lately because its been reasonably stable and cross-platform for 30+ years now...)

mzs 3 years ago

Neat a canvas lib that has support for fonts, clipboard, and printing:

  https://www.tecgraf.puc-rio.br/cd/
example:

  https://www.tecgraf.puc-rio.br/cd/
love2read 3 years ago

Any pictures of what the windows will look like?

shp0ngle 3 years ago

Looking online, it looks very 90s/2000s.

Which might be a good thing for someone.

Maybe it is from 2000s? I see they link to "sourceforge". Which is 2000s thing to do.

laserbeam 3 years ago

I get it, this might be cool. But, it's a UI library! And there's no screenshot on the main page or the overview tab. Guys, come on. Screenshots should be the first thing we see.

  • diego_moita 3 years ago

    > And there's no screenshot on the main page or the overview tab

    On the overview page there is a link called "Screenshots" and I clicked on it and it does really show screenshots.

kookamamie 3 years ago

Why do many (G)UI libraries hide their look & feel to some obscure location? If you want to make an impact, show us what you got on the landing page!

Edit: found the pictures. Looks like another GUI toolkit emulating the 90s OS style paradigms.

  • speeder 3 years ago

    This library actually uses native widgets, the goal of the library is provide cross platform GUI for C and Lua. Also it supports MOTIF because the main sponsor of the library uses MOTIF somewhere (I believe it is Petrobras)

  • eska 3 years ago

    The navigation on the left lists “gallery” and “screenshots”

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection