Site News :: DSL v4.3



Quote
The fans are really loud, though.

Swap them out with your old ones if they're quieter and in decent shape.

mikshaw wrote:
Quote
I wonder if it might be easier to do a check for fltk in the LUA_INIT file before running any fltk commands. This assumes that -lfltk is being used as part of the interpreter as mentioned earlier, and that -lfltk loads fltk before LUA_INIT is read, neither of which I know at this point.  In any case, if it works, I think either method could be used. I only mention sticking with LUA_INIT because it would allow you to skip running dofile in every fltk-enabled script.

I have found the best place for such dofile, in a single location, is /usr/local/share/lua/5.1/fltk.lua, the inititalization for the murgaLua fltk bindings. This way the non-gui lua scripts are not penalized with any extra processing to determine to further process fltk only commands.

Quote

I have found the best place for such dofile, in a single location, is /usr/local/share/lua/5.1/fltk.lua, the inititalization for the murgaLua fltk bindings. This way the non-gui lua scripts are not penalized with any extra processing to determine to further process fltk only commands.


I was going to suggest the same. In fact you could perhaps add the following line just after the invokation of the murgaLua shared lib (the package.loadlib call):
Code Sample

pcall ( function() dofile(os.getenv("HOME".."/.luafltkrc") end )

This would then automatically execute a ".luafltrc" lua file from the user's directory if such file exists.

Yes this works. I have all my scripts running with the plastic theme by putting Fl:scheme("plastic") in ~/.luafltkrc
I agree, pcall is better than just a dofile. Will implement.
BTW slight typo missing close ) after "HOME")



Next Page...
original here.