Eric Wilhelm wrote:
Hi all,

I was using Wx::PaintDC->new($panel) and getting lots of flicker, so I saw this Wx::BufferedPaintDC thing and thought that I would be able to just Wx::BufferedPaintDC->new($panel), but that gives me "unable to resolve overloaded method..."

This might be a bug (in the documentation?), but I found that Wx::BufferedPaintDC->newWindow($panel) does exactly what I wanted.

(Just wish I had found that sooner... well at least my troubles will hopefully seed the search engines.)

--Eric
You want to use:
my $dc = Wx::AutoBufferedPaintDC->new( $self );

Also somewhere in your code you need to set:
$self->SetBackgroundStyle(wxBG_STYLE_CUSTOM);
Now it uses the best DoubleBuffering available on each platform. (Eg: OSX has it natively)

I've been doing Double Buffered drawing for years, even way before the DoubleBuffer stuff was wrapped. Created my own mechanism with one or more wxMemoryDC's blitting the vissible area's to the wxPaintDC
on massive wxScrolledWindows.... ah yes... those where the days.
And now the above two lines provide the same, talking about wishing to find/get that sooner...

Cheers,
Huub

Reply via email to