Programming and Scripting :: dynamic flua button creation
Another update to the package.
Now the display is editable. The preview and save buttons now act on the text in the display window instead of on the original file, so you can make changes to the display and preview or save the changes. If you are messing around with a script it's probably a good idea to turn on "in xterm" so you can receive any error messages it may generate.
I'm getting an increasing number of random segfaults as the number of scripts increases...don't know what's causing it at the moment, but hopefully it'll be fixed soon. Flua loops seem to be a little buggy sometimes.
mikshaw, very nice! Good educational tool for Flua programmers. Thank you for sharing.
Trying to program by reading the doco is one thing but being able to see live examples is another...Wow. In addition being able to 'fiddle' with the code and preview the change... just great.
What Flua documentation do you use? Are there any websites that seem to be helpful?
The only documentation I have are the widget docs at http://lua-fltk.sourceforge.net/ and the Lua4 manual at http://www.lua.org/manual/4.0/
Most of my learning has come from other scripts.
Neither one will tell you everything about scripting flua, but the lua manual is probably the most helpful. The widget manual is neither well written nor complete (no offense to the author, but it's sadly true). Its only use to me is to remind me of the widget names and some of their properties. Once i get my reference tool finished, the widget manual will be useless to me.
I've goooogled at least a few times and there is very little mention of flua online, let alone documentation. Sadly, it may remain a dead project.
I have hope, though, that as more people try DSL and its clones, this tiny interpreter will become more well-known. Maybe the author or someone else with programming experience will pick it up and continue development. As far as I've found, the nearest thing still in development is tcl/tk, which, while still quite small, is several times larger than flua.
Note on the segmentation faults:
I changed the script a little (haven't uploaded yet) and the segfaults seem to have gone. The number of items in the "button" table is now checked only once, and that number is used in the comparison loop. Also, loading of the scripts into the display area is now done with a separate button (select the script, then press load). This means more work for the user, but i think flua was choking when it had to run through a loop and load a file with every click....more so as the table grew in size.
Package updates:
Fixed (or at least reduced the occurrence of) the segfault problem.
Added more widgets.
Minor layout changes.
Renamed the package (most of the scripts are not templates).
http://dsl-mirror.vectori.net/tools/mikshaw/flua_reference.uci
Next Page...
original here.