Giff Windows and Layout - Owen2k6/GoOS GitHub Wiki
A window creates a GoOS Window with a client Canvas:
window Demo {
title "Demo"
x 40; y 40; width 400; height 240
closable true
titlebar true
background "#EDEDED"
onLoad { message "Ready."; }
}
-
title(string) — caption. Defaults to the window's name. -
x,y(int) — screen position. Defaults40, 40. -
width,height(int) — client size. Defaults320, 240. -
closable(bool) — defaulttrue. -
titlebar(bool) — defaulttrue. -
background(colour) — optional fill; if omitted, system default.
Controls are built in declaration order. For overlapping visuals (e.g., an image placeholder then a label), declare the background first.
- Window
Contentsorigin is top-left(0,0). - All control coordinates are relative to the window client area.
- Controls inside a
panelare relative to the panel's(x,y).
Labels can be centred horizontally across the window by setting centre true (or center, etc.). This uses the font metrics to compute x at build time.
label header {
y 8; text "Giff Title"; textColour black; centre true
}
image nodes paint a grey framed placeholder rectangle (useful for layout). To paint solid areas, prefer a panel with a background.
panel banner {
x 0; y 0; width 400; height 36; background "#C0D0FF"
label title { x 8; y 10; text "Banner"; textColour black }
}