// Text of project WallyMath written on 5/9/95 at 12:00 PM // Beginning of file WallyMath.t wmApp := {title: "WallyMath", viewBounds: {left: -3, top: 34, right: 210, bottom: 199}, debug: "wmApp", _proto: @157 }; // Before Script for "wmMathInput" nil // Copyright © 1993-1995 Apple Computer Inc. All rights reserved. wmMathInput := {viewFlags: 133649, viewFormat: 337, viewLineSpacing: 16, viewFont: simpleFont12, viewBounds: {left: 43, top: 67, right: 193, bottom: 97}, lastText: "2 + 2 =", xFunc: func() begin self.text; end, viewChangedScript: func(slot, view) begin if (slot = 'text) then if EndsWith(self.text, "=") then begin try self.xfunc := Compile(SubStr(self.text, 0, StrLen(self.text) - 1)); onexception |evt.ex| do //This should actually also catch div 0 but doesn't begin local e; e := CurrentException(); Print("Error compiling xFunc..."); :SysBeep(); self.lastText := Clone(self.text); return; end; try self.text := NumberStr(Clone(self:xfunc())); onexception |evt.ex| do begin local e; e := CurrentException(); Print("Error calling xFunc..."); :SysBeep(); end; self.lastText := Clone(self.text); end; end, debug: "wmMathInput", viewClass: 81 }; AddStepForm(wmApp, wmMathInput); StepDeclare(wmApp, wmMathInput, 'wmMathInput); _view000 := {text: "Expression:", viewBounds: {left: 50, top: 50, right: 122, bottom: 66}, _proto: @218 }; AddStepForm(wmApp, _view000); constant |layout_WallyMath.t| := wmApp; // End of file WallyMath.t