Lua: work-in-progress library (made in Lua) for object-oriented GUI. Already implements windows, buttons, and dynamic labels.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2055 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
33
share/grafx2/scripts/_tst_dialog2.lua
Normal file
33
share/grafx2/scripts/_tst_dialog2.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
--
|
||||
-- test of GUI library
|
||||
--
|
||||
run("libs/gui.lua")
|
||||
|
||||
local counter = gui.label{x=10, y=54, value=0, format="% .3d"}
|
||||
local form = gui.dialog{
|
||||
title="Dialogtest",
|
||||
w=100,
|
||||
h=150,
|
||||
counter,
|
||||
gui.button{ label="+",
|
||||
x=6, y=38, w=14, h=14, repeatable=true, click=function()
|
||||
counter.value=counter.value+1;
|
||||
counter:render();
|
||||
end},
|
||||
gui.button{ label="-",
|
||||
x=26, y=38, w=14, h=14, repeatable=true, click=function()
|
||||
counter.value=counter.value-1;
|
||||
counter:render();
|
||||
end},
|
||||
gui.button{ label="Help",
|
||||
x=6, y=70, w=54, h=14, click=function()
|
||||
messagebox("Help screen");
|
||||
end},
|
||||
gui.button{ label="Close",
|
||||
x=6, y=18, w=54, h=14, key=27, click=function()
|
||||
return true; -- causes closing
|
||||
end},
|
||||
}
|
||||
|
||||
form:run()
|
||||
|
||||
Reference in New Issue
Block a user