Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local win = getWindowHandel()
- win:setTitle("WIN 3 test3")
- local clickMe = newButton()
- local tButtonsList = {}
- local c = 0
- --[[for x = 1, 4 do
- for y = 1, 4 do
- local cl = newButton()
- cl:setPos((x*10) - 8,(y*3) - 1)
- table.insert(tButtonsList,cl)
- win:addComponent(cl)
- end
- ]]--end
- --clickMe:paint()
- --os.pullEvent()
- win:addComponent(clickMe)
- local function nWin()
- c = c + 1
- local nWin = getWindowHandel()
- nWin:setTitle("newWin"..tostring(c))
- end
- clickMe:setFunction(nWin)
- local x,y = 2,2
- win:setPos(x,y)
- local oldX,oldY
- while true do
- local event = {os.pullEvent()}
- if event[1] == "char" then
- if event[2] == "y" then -- up
- y = y - 1
- elseif event[2] == "h" then
- y = y + 1
- elseif event[2] == "g" then
- x = x - 1
- elseif event[2] == "j" then
- x = x + 1
- end
- win:setPos(x,y)
- end
- --win:setStatus("maximised")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement