rageworx / moonfltk

Lua bindings for FLTK, enhanced little bit more.
Other
0 stars 0 forks source link

MoonFLTK: Lua bindings for FLTK-1.3.5-2-ts

MoonFLTK is a Lua binding library for the Fast Light Toolkit (FLTK) and it modified for my clone.

Requirements

Original Author

Forked & Modified

LUA

Lua logo

License

Documentation

See the Reference Manual.

Getting and installing

Setup the build environment as described here, then:

$ git clone https://github.com/rageworx/moonfltk
$ cd moonfltk
moonfltk$ make -j 4
moonfltk$ make install # or 'sudo make install' (Linux)

Example

-- Script: hello.lua

fl = require("moonfltk")

win = fl.window(340, 180, arg[0])
box = fl.box(20, 40, 300, 100, "Hello, World!");
box:box('up box')
box:labelfont(fl.BOLD + fl.ITALIC)
box:labelsize(36)
box:labeltype('shadow')
win:done() -- 'end' is a keyword in Lua
win:show(arg[0], arg)

return fl.run()

The script can be executed at the shell prompt with the standard Lua interpreter:

$ lua hello.lua

Other examples can be found in the examples/ directory contained in the release package (the examples/fltk subdirectory contains portings to MoonFLTK of most of the examples that come with the FLTK distribution).

Tested on

- Linux Mint 18.3, x86.64
- Embedded Linux
    - Raspberry Pi3B+ ( armhf, debian, lxde )
    - Rockchip RK3399 boards ( Rock960x, Excavator - aarch64, debian, lxde )
    - Odroid XU4 ( aarch64, Ubuntu )

See also