Thursday, September 03, 2009

modification to zetcode tutorial

wxwidgets tutorial at
http://zetcode.com/tutorials/wxwidgetstutorial/menustoolbars/

has the line
wxBitmap exit(wxT("exit.png"));


I get the error in a windows compiler
"failed in wxToolbar::Realize(): invalid tool button bitmap"

the fix:
replace that line with
wxImage exitimage(wxT("exit.png"), wxBITMAP_TYPE_PNG);
wxBitmap exit(exitimage);



note:
don't forget to include #include
and call wxInitAllImageHandlers(); in your app init

No comments: