Code: Select all
@VERSION 6,1
@REQUIRE "RapaGUI"
Function p_ErrorHandler(ErrCode, ErrStr$, ErrCmd, ErrLine)
sel=SystemRequest(HWProgramName$.." Error!", ErrStr$.."\n\nError triggered by Function: "..ErrCmd.."\nLine: "..ErrLine.."\n\nDo you want to Continue or Quit the program?", "Continue|Quit")
If sel=0 Then End()
EndFunction
RaiseOnError(p_ErrorHandler)
AppStr$=[[<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window id="win" title="Test">
<vgroup>
<button>Test Button One</button>
<button>Test Button Two</button>
</vgroup>
</window>
</application>]]
Function p_MakeGUI()
moai.CreateApp(AppStr$)
EndFunction
OpenDisplay(1)
InstallEventHandler({OnMouseUp=p_MakeGUI})
Repeat
WaitEvent
Forever
So if RaiseOnError() is not used, it will work fine on Windows too.