Taking the opportunity of this thread to suggest a look at TekUI, a self contained Lua GUI toolkit. It's quite old but full featured and multiplatform. Years ago I played with it also on embedded boards (Allwinner A10 if memory serves) using both X and the framebuffer.
Looks like it is unmaintained, which is a shame because it has great potential.
http://tekui.neoscientists.org/