GUI Calculator
App: apps/gui_calculator/
A full calculator built with the Nuklear GUI: digits 0–9, operators + − × /, clear (C), and equals (=). Logic lives in a separate calculator.wren module; the main game only runs _calculator.update(dt).
Run from root
Section titled “Run from root”% ./plume3d gui_calculatoror
Run from app directory
Section titled “Run from app directory”% ./../plume3d .What it does
Section titled “What it does”- One full-window GUI: display line plus a 4×4 grid of buttons (digits, C, =, +, −, *, /).
- Implements chained operations: enter number → operator → number → = (or another operator).
- Uses
Gui.layoutRowDynamic(28, 4)for a row of four buttons; multiple rows form the keypad.
- Gui —
beginWindow,layoutRowDynamic,label,buttonLabel,endWindow. - Window —
getWidth,getHeight(calculator fills the window).
Structure
Section titled “Structure”main.wren— Game class, holdsCalculatorand calls itsupdate(dt).calculator.wren—Calculatorclass: display string, pending op/value, and methodsdigit(n),applyOp(op),doEquals().