Giff Events and Commands - Owen2k6/GoOS GitHub Wiki
-
onLoad { ... }
— runs after the window is built. -
onClose { ... }
— runs when the window is closing.
- Button:
onClick { ... }
- Input:
onChange { ... }
- ListBox:
onSelect { ... }
(placeholder for future interaction) - Panel has no events; its children do.
Shows a dialogue with the window's title and the given message.
- Supports
$var
substitution.
message "Hello, $user!";
Disposes the current window and stops subsequent commands in that event.
onClick { close; }
set name = "value"
concat "left", "right", destVar
-
length "source", destVar
— number of characters substr "source", start, len, destVar
All string operands support variable substitution, e.g. "Hello $who"
.
set who = "World";
concat "Hello ", "$who", greeting; // greeting = "Hello World"
length "$greeting", glen; // glen = "11"
substr "$greeting", 6, 5, short; // short = "World"
if "A == B" { ... } else { ... }
if "A != B" { ... }
if "10 > 3" { ... }
if "false" { ... }
if "myVar" { ... } // truthy if var exists and not "", not "0", not "false"
Example:
set mode = "debug";
if "$mode == debug" {
message "Debug on";
} else {
message "Debug off";
}