wxThread modify the wxBitmap of a wxScrolledWindow - HOWTO Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Atka
Earned a small fee
Earned a small fee
Posts: 11
Joined: Mon Nov 27, 2006 5:58 pm
Location: Hungary

wxThread modify the wxBitmap of a wxScrolledWindow - HOWTO

Post by Atka »

Hi All!
I'm new here and I started to writing some programs in wxWindows.
I have a situation I describe now:

I have a thread which extends from the wxThread called MyThread.
I have a scrolled window which extends from the wxScrolledWindow called MyCanvas.

The MyCanvas class has an attribute which is wxBitmap called myBitmap.
This is a blank bitmap.
The MyCanvas override the onPaint method of the wxScrolledWindow class.
MyCanvas has vertical and hotrizontal scrollbars, too.

The wxFrame is MyFrame in which the MyCanvas is, and the MyFrame size is 800x600.
The myBitmap size in the MyCanvas is 1024x768, so both of the scrollbars are visible.

The MyThread do the following (it is easy):
It begins at the same time as the MyFrame, and load a picture into myBitmap and after a min it load another picture. So the thread always switching between these 2 picture.
And during switching you can use the scrollbars, too.

So thats all!!

MY QUESTION:

I would like to write a program like the upper and I would like to compile both
in Windows and in Linux systems, too. I tried it, but in Windows th OnPaint method calls were so much, i worried:( I would like to avoid flicking window, both in Windows and Linux.

There is anybody, who can help me? Give me anybody an example code like this, or write for me, because I wrote it, but under Windows XP it isn't work correctly.
Thanks a lot!

Atka
Peer Sommerlund
Knows some wx things
Knows some wx things
Posts: 43
Joined: Tue Jun 13, 2006 7:21 am
Location: Denmark
Contact:

Post by Peer Sommerlund »

Maybe the wxWiki can help you. It contains a page about Flicker-Free Drawing
Atka
Earned a small fee
Earned a small fee
Posts: 11
Joined: Mon Nov 27, 2006 5:58 pm
Location: Hungary

Post by Atka »

Thank for your help!

I have solved the flickering problem. I only overrided the OnEraseBackground event, and the flickering disappeared.

It is interesting, because I shouldn't do that under linux.

Merry Christmas!

Atka
Post Reply