System Commands
(path, environment)
start_appStarts the app located at path
, with environment
as env.
Returns the PID of the new app or nil
.
local app = start_app("apps/myapp.nib", {
super = "cool"
})
if app then
-- Yes!!
end
The environment variables x
, y
, width
and height
control the area of the
screen which the new app will be allowed to draw.
WARNING: if the app draws using direct memory writes this is not enough to constrain it to a specific area of the screen.
start_app("apps/constrained.nib", {
x = 10, y = 10,
width = 100, height = 100,
})
(pid)
stop_appStops a given app. If pid
is 0, stop itself.
stop_app(0)
Pause/Resume
(pid)
pause_appWARNING: you cannot pause apps which you did not start
Pause the given app.
(pid)
resume_appWARNING: you cannot resume apps which you did not start
Resume the given app.
Message passing/IPC
(pid, message)
send_messageThe message
(an arbitrary value) will be sent to the app of PID = pid
.
It can use receive_message()
to receive it
()
receive_messageReturns the next message or nil
.