wxGCDC sample

BlitzMax Forums/Brucey's Modules/wxGCDC sample

Nigel Brown(Posted 2008) [#1]
Brucey, is there an example using the wxGCDC anywhere? I am particularly interested in overlaying buttons over the DC.


Brucey(Posted 2008) [#2]
It probably wants one.

But you should be able to do something like this, in your Paint event :
	Function OnPaint(event:wxEvent)

		Local canvas:MyWidget = MyWidget(event.parent)

		Local pdc:wxPaintDC = New wxPaintDC.Create(canvas)
		Local dc:wxGCDC = New wxGCDC.Create(pdc)
		canvas.PrepareDC(dc)
...

		dc.Free()

Not sure if you need to implicitly free the wxPaintDC too. (you'll find out on Windows soon enough, if you do).