The server
library provides helper functions for interacting with the server and othe rremotes.
local server = require("server");
Tells the server to load (create) the specified remote.
server.load("Unified.Chrome");
Tells the server to unload (destroy) the specified remote.
server.unload("Unified.Chrome");
Tells the server to run an action for the specified remote.
server.run("Unified.Chrome", "back");
server.run("Unified.Command", execute", "echo foobar");
The server will automatically load (create) the remote.
Perform one or more layout updates for the active remote.
server.update(
{ id = "info", text = "foobar" },
{ id = "tgl", checked = true }
);
For simple updates, you can use the layout helper library instead.
This function should be used to perform advanced updates such as lists.
local items = {
{ type = "item", text = "item 1" },
{ type = "item", text = "item 2" },
{ type = "item", text = "item 3" }
};
server.update({ id = "list", children = items });
As well as creating dialogs:
server.update({
type = "dialog",
text = "Hello World!",
children = {
{ type = "button", text = "Foo" },
{ type = "button", text = "Bar" }
}
});