diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 02:26:30 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 02:32:26 +0200 |
commit | 7505e88db66798b2b8fcdff2d92a7136cd826b5b (patch) | |
tree | b6ced565318f8e8112e35cb0ad53abe4212ef8de /iup/srclua5/iuplua.lua | |
parent | e9a184546b18cf3b796bd560561f312934004c54 (diff) |
Upgrading to IUP 3.2 - and cleaning up.
Diffstat (limited to 'iup/srclua5/iuplua.lua')
-rwxr-xr-x | iup/srclua5/iuplua.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/iup/srclua5/iuplua.lua b/iup/srclua5/iuplua.lua index 01465d5..a58656f 100755 --- a/iup/srclua5/iuplua.lua +++ b/iup/srclua5/iuplua.lua @@ -236,13 +236,13 @@ iup.SetClass(iup.BOX, "iup widget") iup.error_message_popup = nil -function iup._ERRORMESSAGE(err,traceback) - err = err..(traceback or "") +function iup._ERRORMESSAGE(msg,traceback) + msg = msg..(traceback or "") if (iup.error_message_popup) then - iup.error_message_popup.value = err + iup.error_message_popup.value = msg else local bt = iup.button{title="Ok", size="60", action="iup.error_message_popup = nil; return iup.CLOSE"} - local ml = iup.multiline{expand="YES", readonly="YES", value=err, size="300x150"} + local ml = iup.multiline{expand="YES", readonly="YES", value=msg, size="300x150"} local vb = iup.vbox{ml, bt; alignment="ACENTER", margin="10x10", gap="10"} local dg = iup.dialog{vb; title="Error Message",defaultesc=bt,defaultenter=bt,startfocus=bt} iup.error_message_popup = ml @@ -254,9 +254,9 @@ end iup.pack = function (...) return {...} end -function iup.protectedcall_(f, err) +function iup.protectedcall(f, msg) if not f then - iup._ERRORMESSAGE(err) + iup._ERRORMESSAGE(msg) return end local ret = iup.pack(pcall(f)) @@ -265,12 +265,12 @@ function iup.protectedcall_(f, err) return else table.remove(ret, 1) - return unpack(ret) + return unpack(ret) --must replace this by table.unpack when 5.1 is not supported end end -function iup.dostring(s) return iup.protectedcall_(loadstring(s)) end -function iup.dofile(f) return iup.protectedcall_(loadfile(f)) end +function iup.dostring(s) return iup.protectedcall(loadstring(s)) end +function iup.dofile(f) return iup.protectedcall(loadfile(f)) end function iup.RGB(r, g, b) return string.format("%d %d %d", 255*r, 255*g, 255*b) |