hi with the following code:
should i not be able to do
...although if i do it throws and error with the line?
Strict Type TTestApp Field Window:TGadget = CreateWindow("",0,0,640,480) Field Button:TGadget = CreateButton("BUTTON",0,0,100,20,Window) Field Canvas:TGadget = CreateCanvas(0,20,ClientWidth(window),ClientHeight(window)-20,window,PANEL_BORDER) Method New() AddHook EmitEventHook,eventhook,Self Button.SetLayout(1,0,1,0) Canvas.SetLayout(1,1,1,1) EndMethod Function eventhook:Object(id,data:Object,context:Object) If TTestApp(context) Then TTestApp(context).OnEvent TEvent(data) Return data EndFunction Method OnEvent(event:TEvent) Select event.id Case EVENT_WINDOWCLOSE Select Event.Source Case window End End Select Case EVENT_GADGETACTION Select Event.Source Case Button Notify "You pressed the button" EndSelect Case EVENT_GADGETPAINT Select Event.Source Case Canvas SetGraphics(CanvasGraphics(canvas)) SetViewport(0,0,ClientWidth(canvas),ClientHeight(canvas)) Cls DrawText "TEST CANVAS",10,10 Flip 0 EndSelect EndSelect EndMethod EndType Global App:TTestApp = New TTestApp While True WaitEvent() Wend
should i not be able to do
Global App:TTestApp = New TTestApp Global App2:TTestApp = New TTestApp
...although if i do it throws and error with the line?