Quick and Dirty IUP on Linux

in GUI, IUP, Lua

IUP is an amazingly simple to use, modern GUI toolkit. It can be completely programmed in C or Lua. Many users use it for C++ as well. It runs over GTK, Win32, and Motif.

The full project page is here:

http://www.tecgraf.puc-rio.br/iup/

However, here is my Quick and Dirty Guide for IUP on Linux systems:

Download a 3.0rc3 executable (or more current) for Linux that fits your arch and the GCC version of your libs (or whatever you might link into your app). The IUP project pages will link you over to SourceForge.

Please note that the Linux binaries are not in the folder that says "Newest Files" or even "Linux Binaries"....those are the libs by themselves. How cryptic is that? Well, it reflects the notion that lots of IUP users use the C API. In fact, the tarball I'll direct you to below has those same .so libs, as well as a useful app in C that lets you load Lua scripts quickly.

Get your tarball from the "Tools Executables" dir on SourceForge.
For me, the download was "iup3_0_rc3_Linux26g4_64_bin.tar.gz".

You'll also need the examples, because I said so. That tarball is in the "Docs and Sources" dir on SourceForge. You'll want something like "iup3_0_rc3_Examples.tar.gz"

Unzip it all somewhere, like ~/bin perhaps.

The directory includes a couple of executables and the .so libraries. These libs need to be in your LD_LIBRARY_PATH. You already know how to do this.

Run ./iuplua51, and a GUI app comes up titled "IupLua console". Now we're cookin'!

Most of the area in the window is a space to load or paste a lua script, like one of the example scripts. Click on "Load", browse to the directory containing the examples, like ~/bin/iup/html/examples/Lua. A good sone is "idle.wlua", which shows the simplicity of getting a window up, and has a snip of some lua code. Sample.wlua is sort of a kitchen-sink display of a lot of the widgets.

Note that the scrips run the same in a Win32, GTK, or Motif environment. Some of this nicety is shown by "colorbrowser.lua", which uses a one-liner table constructor, cb = iup.colorbrowser{}, to invoke the native color picker.

Note that running "glcanvas.wlua" requires LuaGL. An exercise to the reader.

Further reading includes:

http://www.tecgraf.puc-rio.br/iup/en/basic/index.html --a basic guide.

http://doris.sourceforge.net/ -- which is not done in IUP, but it's cool OpenGL stuff.

http://love2d.org/ -- not IUP, but heck, you can write a whole game pretty quickly.