немножко раскидал функции по отдельным файлам && add helloWorld example

This commit is contained in:
Egor00f committed 2025-04-05 20:29:18 +05:00
1 parent 5dc9f2ca31
commit 96eb2c55d3
13 files changed
+410 -267

No files matched your search

+25 -2
View File
@@ -4,6 +4,29 @@ local SystemColors = syscalls.GetSystemColors()
print(SystemColors)
for i, v in pairs(SystemColors) do
print(i, v)
function DEC_HEX(IN)
local B, K, OUT, I, D = 16, "0123456789ABCDEF", "", 0
while IN > 0 do
I = I + 1
IN, D = math.floor(IN / B), math.mod(IN, B) + 1
OUT = string.sub(K, D, D) .. OUT
end
return OUT
end
local keys = {
"frameArea",
"workArea",
"grabBar",
"grabBarButton",
"grabButtonText",
"grabText",
"workButton",
"workButtonText",
"workGraph",
"workText"
}
for _, v in pairs(keys) do
print(v .. ':', "#" .. DEC_HEX(SystemColors[v]))
end
+24
View File
@@ -0,0 +1,24 @@
local syscalls = require("syscalls")
local function Redraw()
syscalls.StartRedraw()
syscalls.CreateWidnow(100)
syscalls.EndRedraw()
end
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
exit = true
end
end
end
print("End")
+9 -2
View File
@@ -1,3 +1,10 @@
for i, v in pairs(require("syscalls")) do
print(i, v)
local function tree(t)
for i, v in pairs(t) do
if type(v) == "table" then
tree(v)
end
end
end
tree(require("syscalls"))