diff --git a/tests/helloWorld.lua b/tests/helloWorld.lua index 4f733a8..e01b07d 100644 --- a/tests/helloWorld.lua +++ b/tests/helloWorld.lua @@ -1,24 +1,40 @@ local syscalls = require("syscalls") -local function Redraw() +local systemColors = syscalls.GetSystemColors() + + + +local function redraw() syscalls.StartRedraw() - syscalls.CreateWidnow(100) + syscalls.CreateWindow(100, 100, 200, 200, "Hello World", systemColors.workArea, 3) + + local t = syscalls.ThreadInfo(-1) + + + local y = syscalls.GetSkinHeight() + for i, v in pairs(syscalls.textSize) do + local a = string.gmatch(i, "(%d+)")() + syscalls.DrawTextFixSize("HelloWorld " .. i, math.floor(t.winXSize / 8), y, systemColors.workText, v) + y = y + tonumber(a) + 24 + end syscalls.EndRedraw() end +redraw() + local exit = false while not exit do local event = syscalls.WaitEvent() - if event == syscalls.Redraw then - Redraw() - elseif event == syscalls.Button then - if syscalls.GetButton() == syscalls.buttons.close then + if event == syscalls.Event.Redraw then + redraw() + elseif event == syscalls.Event.Button then + local ButtonID = syscalls.GetButton() + + if ButtonID == syscalls.buttons.close then exit = true end end end - -print("End")