lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2016-06-21 2:10 GMT+02:00 Egor Skriptunoff <egor.skriptunoff@gmail.com>:

> https://github.com/Egor-Skriptunoff/pure_lua_alert
>
> The functionality is similar to JavaScript alert() function.
> "alert()" creates a window with specified text and waits
> until user closed the window (by pressing any key).
>
> local alert = require("alert")
> alert("Hello")
>
> "alert.lua" is pure Lua module, compatible with Lua 5.3, 5.2, 5.1, and
> LuaJIT.
> It does not depend on any C library, all it needs is "os.execute()" and
> "io.popen()".
> It works on Linux, Mac OS X, Windows and Cygwin.
>
> "alert()" performs its task by invoking terminal emulator
> and executing shell command "echo YourMessage" inside it:
> 1) "CMD.EXE" (Windows Command Prompt) is used on Windows and Cygwin;
> 2) "Terminal.app" is used on Mac OS X;
> 3) any of 17 supported terminal emulators (if found to be installed on your
> system)
> is used on Linux.

This is fun!

Can the technique be expanded to give pure Lua dialog and
radio boxes? File selection?