
IUP Portable User Interface: Multi-Platform Toolkit for Building GUI in C or Lua - vmorgulis
http://webserver2.tecgraf.puc-rio.br/iup/
======
pierrec
Using this library and others, there's a neat trick to make Lua GUI programs
that fit in a single executable file without dependencies. Of course, the
traditional "brute force" way of doing this is to make a self-extracting
archive. But the classier way is to use srlua:

[http://webserver2.tecgraf.puc-
rio.br/~lhf/ftp/lua/#srlua](http://webserver2.tecgraf.puc-
rio.br/~lhf/ftp/lua/#srlua)

Basically, it's a slightly modified Lua interpreter, which you literally
concatenate with your script. When run, the interpreter tries to run the
script that's appended. Although the srlua documentation was pretty vague on
the subject, I've successfully linked it statically with this IUP library, so
the appended script can load it and display a nice GUI. Maybe not always the
optimal way of distributing programs, but I thought it was cool (you could
even make an executable that allows you to graphically edit its own Lua
source, though you might have to work around the fact that a running file
isn't writable on some platforms).

~~~
ers35
You may be interested in a tool I wrote that builds standalone executables:
[https://github.com/ers35/luastatic](https://github.com/ers35/luastatic)

For the following program:

    
    
      iup.Message('test', 'hello world')
    

Build the program to a standalone executable:

    
    
      luastatic example.lua /usr/lib/x86_64-linux-gnu/liblua5.2.a -I/usr/include/lua5.2 libiup.a libiuplua52.a libiupcontrols.a `pkg-config --cflags --libs gtk+-3.0` -lX11

------
striking
This is cool, because it has quite a few more controls available than
something similarly licensed and minimal (like libui).

One thing, though. What about Mac OS support?

edit: a page mentions Mac OS support via GTK and Quartz, as well as GTK and
X11. ([http://webserver2.tecgraf.puc-
rio.br/iup/en/drv/gtk.html](http://webserver2.tecgraf.puc-
rio.br/iup/en/drv/gtk.html)) But I guess this isn't nearly as well-supported.

~~~
mushiake
Eric Wing is sort of working on it.
[https://sourceforge.net/p/iup/mailman/message/34307825/](https://sourceforge.net/p/iup/mailman/message/34307825/)
[https://github.com/ewmailing/IupCocoa/tree/Cocoa](https://github.com/ewmailing/IupCocoa/tree/Cocoa)

------
wrp
IUP is not a huge system like Qt/GTK+/wxWidgets and the code for GUIs is
relatively concise. I think this lends to a perception that IUP is just a
simple system for simple applications. Actually, it is focused on engineering
applications, with some powerful widgets for data entry and visualization.

The development team is small but very active and responsive. Windows is well
supported along with various flavors of Unix. IUP doesn't seem to get much use
on Linux. I think IUP doesn't insulate you from the platform as much as Qt
does, so cross-platform work takes a bit more care. Not all the features
available on Windows will be supported on GTK/Motif.

Even if the only target is Windows, IUP may be worth considering for the clean
code, convenient layout management, and the data-oriented widgets.

------
digi_owl
Well that was unexpected, a N800.

[http://webserver2.tecgraf.puc-
rio.br/iup/en/screenshots/n800...](http://webserver2.tecgraf.puc-
rio.br/iup/en/screenshots/n800_photo.jpg)

Sadly these days i feel mixed emotions, and i keep finding that Linux desktop
development seems to have gone off the rails thanks to that thing.

~~~
frik
> Linux desktop development seems to have gone off the rails thanks to that
> thing.

It started earlier. KDE3 used to be great and very Windows-like desktop
experience on Linux/*BSD. Then they choose to rewrite KDE and make it more
like OSX, the illfated KDE4 and its slow XML KBus trainwreck followed and
burned the KDE platform. Many users switched to Gnome 2 which barely got
useable with less features than other desktop platforms. Then the whole Tizen
(Intel, Nokia, Samsung, ...) debacle with multiple UI frameworks competiting
instead of focusing the resources. The whole thing is dead, beside Bada/Tizen
is used in Samsung SmartTVs and SmartWatches and waiting in sleep-mode as
backup strategy in case Google changes direction with Android. Then Gnome
changed direction and rewrote Gnome with Gnome 3. Many users now switched to
distributions that forked Gnome 2 like Mint or replaced it with a Gnome 2 like
experience (Ubuntu).

What a sad desktop experience there is nowadays. For desktop experience I
favor Windows 7 UI theme or Windows 2000 classic UI, or previously KDE3 (is
there a up-to-date fork?). macOS and Ubuntu are okay too. For touch Android 5+
and iOS 6 have the best UI in my opinion.

Sadly many have lost their way and alinated their userbase with illfated
design decisions (Win8/10, WinPhone7/8/10, KDE4, Gnome3, Tizen). I am looking
forward to the new OS from Google, called Magenta/Fuchsia.

And nowadays the browser is like a second OS and Chrome with its simple UI is
great. I dislikevthe weird round tbs in Firefox. IE11 was fine too, but MS
lost its way. The Win10Store and XBoxOne are failing and have comparable
little marketshare - several former exclusive titles now get released for
Win7+ and on Steam as well - good that people aren't dumb, and MS evil
strategies failed. Now they need a new CEO who axes and fires the people
responsible for the last 5 years. Create a Windows 11 without privacy issues
and a nice UI that can changed to look like Win classic and 7.

~~~
ashitlerferad
KDE3 fork: [https://www.trinitydesktop.org/](https://www.trinitydesktop.org/)

~~~
digi_owl
Gotta say i love the old KDE3 tarball organization.

Once you have Qt and some other dependencies in place you build it up layer by
layer.

present day KDE seems to have taken a page from Gnome, and now is a sprawling
mess of tarballs.

The closest i have come to KDE3 on the GTK side is XFCE.

Similarly, while i understand that breaking things down to multiple tarballs
have made developer life easier over at Xorg, building it requires compiling a
pile of small tarballs.

~~~
groovy2shoes
> _Similarly, while i understand that breaking things down to multiple
> tarballs have made developer life easier over at Xorg, building it requires
> compiling a pile of small tarballs._

I wonder if Xenocara works on anything other than OpenBSD...

I sympathize with your sentiment. Trying to maintain packages even for
something as small as Xfce has been a nightmare (with all the Xfce-goodies, at
least). I can't imagine what it would take to maintain so many packages needed
for KDE and Xorg these days.

While "modular" sounds nice in theory, in practice you wind up wanting most of
the modules anyway, so the modularity just becomes a pain in the ass. At the
very least, some sort of "mega module(s)" would be nice: one could provide
everything, one could perhaps provide a "20% of the code for 80% use cases"
type of subset, perhaps there could be various customizations for special
purpose applications, etc...

------
eggy
I first used it with CHICKEN Scheme. There's a distro that includes IUP and
the Canvas egg for Windows. Eggs are the containers for CHICKEN Scheme
packages.

Great for quick, and not too bad looking, GUIs from C or CHICKEN. I haven't
tried Lua or the LED mentioned.

------
netghost
> It offers a simple API in three basic languages: C, Lua and LED

I haven't been able to find any reference to LED as a language, anyone have a
link? Just curious.

~~~
hatfieej
I think it was a language they developed to be used with IUP. Original
research paper: [http://webserver2.tecgraf.puc-
rio.br/iup/download/spe95.pdf](http://webserver2.tecgraf.puc-
rio.br/iup/download/spe95.pdf) Under "Resources->LED" on the site there is
some more information: [http://webserver2.tecgraf.puc-
rio.br/iup/en/led.html](http://webserver2.tecgraf.puc-rio.br/iup/en/led.html)

~~~
eggy
Check the site. There's a nice example there. It is basically a script-like
way of building interfaces. The cool thing is that it is loaded as a resource,
so you can edit the LED script after compiling, and as long as you haven't
changed any of the identifier names, you can modify the GUI.

I am going to try that this week. Sounds like a nice compromise between the
newer 'Immediate-Mode GUIs' and the standard event-based one. I can see it as
a way to let the user skin your app within your control of how much they can
modify.

