Prev: Problem with wxGrid RTL Layout
Next: wxpython: wx.media.MediaCtrl with icecast streaming: won't work as expected.
From: Joost Kraaijeveld on 25 Dec 2008 06:19 Hi, I am writing a multiplatform application (Linux/Windows) and want to use XPM files as my source for icons and (button)bitmaps so that the files can be replaced without compiling. It works flawless on Linux, but on Windows I get a run-time error: "No image handler for type 9 defined", if I use code like: SetIcon(wxIcon(wxT("my_icon.xpm"),wxBITMAP_TYPE_XPM )); I think that I have compiled in XPM support as there is a "#define wxUSE_XPM 1" in my setup.h, which is generated by running "../configure --enable-unicode" in MSys/MinGW. Is there something special I should do to make XPM files work on Windows? TIA -- Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 web: www.askesis.nl
From: Chris Elliott on 25 Dec 2008 06:23 you need to call wxInitAllImageHandlers() http://biolpc22.york.ac.uk/wx/docs/html/wx/wx_appinifunctions.html#wxinitallimagehandlers chris On 25 Dec 2008, at 11:19, Joost Kraaijeveld wrote: > Hi, > > I am writing a multiplatform application (Linux/Windows) and want to > use > XPM files as my source for icons and (button)bitmaps so that the files > can be replaced without compiling. > > It works flawless on Linux, but on Windows I get a run-time error: "No > image handler for type 9 defined", if I use code like: > > SetIcon(wxIcon(wxT("my_icon.xpm"),wxBITMAP_TYPE_XPM )); > > > I think that I have compiled in XPM support as there is a "#define > wxUSE_XPM 1" in my setup.h, which is generated by running "../ > configure > --enable-unicode" in MSys/MinGW. > > Is there something special I should do to make XPM files work on > Windows? > > TIA > > -- > Groeten, > > Joost Kraaijeveld > Askesis B.V. > Molukkenstraat 14 > 6524NB Nijmegen > tel: 024-3888063 / 06-51855277 > fax: 024-3608416 > web: www.askesis.nl > > > _______________________________________________ > wx-users mailing list > wx-users(a)lists.wxwidgets.org > http://lists.wxwidgets.org/mailman/listinfo/wx-users
From: Carsten A. Arnholm on 25 Dec 2008 14:10 Joost Kraaijeveld wrote: > Hi, > > I am writing a multiplatform application (Linux/Windows) and want to > use XPM files as my source for icons and (button)bitmaps so that the > files can be replaced without compiling. > > It works flawless on Linux, but on Windows I get a run-time error: "No > image handler for type 9 defined", if I use code like: > > SetIcon(wxIcon(wxT("my_icon.xpm"),wxBITMAP_TYPE_XPM )); > > > I think that I have compiled in XPM support as there is a "#define > wxUSE_XPM 1" in my setup.h, which is generated by running > "../configure --enable-unicode" in MSys/MinGW. > > Is there something special I should do to make XPM files work on > Windows? > > TIA
From: Carsten A. Arnholm on 25 Dec 2008 14:18
Joost Kraaijeveld wrote: > Hi, > > I am writing a multiplatform application (Linux/Windows) and want to > use XPM files as my source for icons and (button)bitmaps so that the > files can be replaced without compiling. > > It works flawless on Linux, but on Windows I get a run-time error: "No > image handler for type 9 defined", if I use code like: > > SetIcon(wxIcon(wxT("my_icon.xpm"),wxBITMAP_TYPE_XPM )); > > > I think that I have compiled in XPM support as there is a "#define > wxUSE_XPM 1" in my setup.h, which is generated by running > "../configure --enable-unicode" in MSys/MinGW. > > Is there something special I should do to make XPM files work on > Windows? Looks like you are trying to read from an XPM file. I use XPM on Windows and Linux in a slightly different way. As XPM is just C/C++ code, I put it in a header file and compile it like other code. Then, it is a simple matter of #include "icons_xpm.h" .. .. wxIcon icon(icon16x16_xpm); where icon16x16_xpm is defined in the "icons_xpm.h" header file. -- Carsten A. Arnholm http://arnholm.org/ N59.776 E10.457 |