18 lines
438 B
Plaintext
18 lines
438 B
Plaintext
function timer_cb(Ihandle /*ih*/)
|
|
IupUpdate(canvas)
|
|
return IUP_IGNORE
|
|
end function
|
|
|
|
Ihandle timer = IupTimer(Icallback("timer_cb"), 1000)
|
|
|
|
function key_cb(Ihandle /*ih*/, atom c)
|
|
if c=K_ESC then return IUP_CLOSE end if
|
|
if c=K_F5 then
|
|
iteration = 0
|
|
IupSetInt(timer,"RUN",1) -- (restart timer)
|
|
end if
|
|
return IUP_CONTINUE
|
|
end function
|
|
|
|
IupSetCallback(dlg, "K_ANY", Icallback("key_cb"))
|