Programming and Scripting :: xmessage or lua fltk



Just messing around with some stuff, and i noticed that lua-fltk will read stdin as a file.  I'm sure there are piles of uses for this, but the first one that came to mind is that flua can emulate xmessage from a shell script or xterm.  I know Robert has made a popup script for this purpose (or something very similar) already, and now i'm starting to wonder if xmessage might be easily replaced by a few lines of code.
Code Sample
echo "fl_message(\"some text\")"|flua

Code Sample
echo -e "fl_message(\"some text\")\nfl_message(\"some more text\")"|flua

This might be expanded to use a browser for displaying a text file, and accept xmessage parameters...it seems as though a tiny script could fully and seemlessly replace xmessage.  The thing i'm not sure of is how the exit codes could be implemented.

echo 'fl_message("Some Text 2")'|flua

Works with out the back slashes.

However fl_alert does not?  The lua FTLK manual has like 3 lines that says these FTLK standard dialogs are there but I've been having trouble finding examples or documentation for them.  I've found doc for them at the FLTK site but it's of no help.  fl_alert( char *, ...)    All of the fl_dialogs show the ", ...)" which is??

Ok, you get beer money when you fully replicate zenity in flua. :-)
zenity exists on my CD?
Quote (Glacial @ May 04 2006,12:52)
However fl_alert does not?  The lua FTLK manual has like 3 lines that says these FTLK standard dialogs are there but I've been having trouble finding examples or documentation for them.  I've found doc for them at the FLTK site but it's of no help.  fl_alert( char *, ...)    All of the fl_dialogs show the ", ...)" which is??

I noticed that too.  According to the docs, lua-fltk was a 1-weekend project, so my guess is that Mr. Carlson did what he felt like doing at the moment and never really finished it.  There are actually several standard fltk widgets that have little or no functionality in lua fltk.
Next Page...
original here.