Giff Events and Commands - Owen2k6/GoOS GitHub Wiki

Events & Commands

Window events

  • onLoad { ... } — runs after the window is built.
  • onClose { ... } — runs when the window is closing.

Control events

  • Button: onClick { ... }
  • Input: onChange { ... }
  • ListBox: onSelect { ... } (placeholder for future interaction)
  • Panel has no events; its children do.

Command catalogue

message "text"

Shows a dialogue with the window's title and the given message.

  • Supports $var substitution.
message "Hello, $user!";

close

Disposes the current window and stops subsequent commands in that event.

onClick { close; }

Variables

  • 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"

Conditionals

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";
}
⚠️ **GitHub.com Fallback** ⚠️