OnPaint Problem in windows

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
cidhuang
In need of some credit
In need of some credit
Posts: 3
Joined: Fri Oct 02, 2009 9:22 am

OnPaint Problem in windows

Post by cidhuang » Fri Oct 02, 2009 9:38 am

Hi,

I use wxFormBuilder v3.0.57 + wxWidgets 2.8.10 made by MinGW and MSYS to build the attatched project. I want to show a png file on a Scrolled Window.

As long as OnPaintPreview, OnPaint handler of wxScrolledWindow, appears, the application can not be destroyed, and nothing is ever shown. If I remark OnPaintPreview declaration and implementation, the program can be destroyed, and nothing is shown. I surfed some webs but found no solution. Could any one give me a hand?

Thanks.

Cid
Attachments
iFusionApp.zip
(15.87 KiB) Downloaded 30 times

spectrum
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Sat Jul 21, 2007 12:17 pm

Post by spectrum » Fri Oct 02, 2009 1:54 pm

just to understand better could you simply try

void iFusionFrame::OnPaintPreview( wxPaintEvent& event )
{
wxPaintDC dc(this);
dc.DrawBitmap( *bmp, 0, 0, false );
}

and then commenting

dc.DrawBitmap( *bmp, 0, 0, false );

thanks
spectrum

cidhuang
In need of some credit
In need of some credit
Posts: 3
Joined: Fri Oct 02, 2009 9:22 am

Post by cidhuang » Sat Oct 03, 2009 3:57 pm

both don't work. As long as OnPaint appears, the program runs strangely.

Should I try wxPack instead of building wxWidgets with MinGW and MSYS by myself?

Cid

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Sat Oct 03, 2009 5:10 pm

Did you see http://wiki.wxwidgets.org/Scrolling ? (sorry, don't feel like downloading code)
"Keyboard not detected. Press F1 to continue"
-- Windows

Post Reply