Doc - gui


_G.pos.gui

PeterOS GUI package, handles drawing windows and routing events

Variables

Type Name Description
table mt GUI class meta tables by class name
boolean running If the gui is currently running
Logger _log GUI log

Functions

Return Name Description
nil setLog(log: Logger) Sets the GUI logger
number addWindow(window: Window) Adds a window to be drawn and processed, returns window index
nil removeWindow(window: Window|number) Removes the passed window, or by window index
nil removeWindow(x: number, y: number, active: boolean, color: number) Sets the cursor position, blink status, and color
nil redrawWindows() Internal. Draws all visible windows
nil processWindows(event: table) Internal. Processes event for focused window
nil focusWindow(window: Window|number) Focuses the passed window, or by window index
nil unfocuseWindow(window: Window|number) Un-focuses the passed window, or by window index
nil run(func: function) Run window draw and process loop. Runs until pos.gui.running is set to false calling func(event) for every event

Classes

Name Description
UiElement Abstract GUI element
Window Basic GUI window
MenuOption Window menu bar dropdown menu
TextBox Basic GUI text box
TextInput Basic GUI text input
Button Basic GUI button
ScrollField Scroll field with sub-elements
FileSelector File selector GUI window