Buttons on Canvas don't work

Miscellaneous Forums/MacOS X Discussion/Buttons on Canvas don't work

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Brucey, great tip I have been working with this today and managed to get buttons ontop of a panel with a background that I can render to. Only a couple of problems one seems to be with the GLMax2DDriver() the other I'm not sure about? Both problems have been commented out so should work on both PC and Mac as is. Mac cannot render to a canvas that is attached to a hidden window with the GLMax2DDriver either on PC or Mac.


SuperStrict

Local mywindow:Tgadget=CreateWindow("example",400,200,320,240)
Local mypanel:Tgadget=CreatePanel(0,0,320,240,mywindow) ; SetGadgetLayout(mypanel, 1, 0, 1, 0 )
Local mycanvas_window:TGadget = CreateWindow( "",0,0,320,240,Null,WINDOW_CLIENTCOORDS )'| WINDOW_HIDDEN )
Local mycanvas:TGadget=CreateCanvas(0,0,320,240,mycanvas_window) ; SetGadgetLayout(mycanvas, 1, 0, 1, 0 )
Local background:TImage=LoadImage(AppDir + "/resources/background1.jpg")
Local imagebuffer:TImage=CreateImage(320,240,1,DYNAMICIMAGE|MASKEDIMAGE)

Local button:TGadget=CreateButton("HELP",110,30,64,24,mypanel,BUTTON_CANCEL)

?Win32	SetGraphicsDriver BufferedD3D7Max2DDriver()
'?Win32	SetGraphicsDriver D3D7Max2DDriver()
?MacOs	SetGraphicsDriver GLMax2DDriver()
?
SetGraphics( CanvasGraphics(mycanvas) )
SetBlend(ALPHABLEND)
SetAlpha(1.0)

Local verdana:TImageFont = LoadImageFont( AppDir + "/resources/vera.ttf", 24, SMOOTHFONT )
SetImageFont verdana

CreateTimer(20)

Repeat 

	Select WaitEvent()

		Case EVENT_WINDOWCLOSE
			End
			
		Case EVENT_TIMERTICK

			SetGraphics( CanvasGraphics(mycanvas) )
			DrawImage(background,0,0)
'			SetColor(0,0,0)
			DrawText("HELP ME",0,0 )
			
			GrabImage(imagebuffer,0,0)
			SetPanelPixmap(mypanel, LockImage(imagebuffer))
			UnlockImage(imagebuffer)
	End Select

Forever