Loading an icon in a wxmenubar

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
Egros
In need of some credit
In need of some credit
Posts: 2
Joined: Sat Feb 11, 2012 4:06 pm

Loading an icon in a wxmenubar

Post by Egros »

I am new to C++ and wxDev-C++ and trying to get familiar with wxDev-C++ by working through the pdf book “ Programming with wxDev- C++” in the help file.I notice that in the example how to load a picture (bitmap) in a wxmenubar using version 7.4.1 it generate the following error message when I compile it.

17 C:\Program Files\Dev-Cpp\New Projects\MenuSample\MenuSampleFrm.cpp Images/MenuSampleFrm_ID_MNU_ITEMWITHPICTURE_1003_XPM.xpm: No such file or directory.
C:\Program Files\Dev-Cpp\New Projects\MenuSample\MenuSampleFrm.cpp In member function `void MenuSampleFrm::CreateGUIControls()':
56 C:\Program Files\Dev-Cpp\New Projects\MenuSample\MenuSampleFrm.cpp `MenuSampleFrm_ID_MNU_ITEMWITHPICTURE_1003_XPM' was not declared in this scope
C:\Program Files\Dev-Cpp\New Projects\MenuSample\Makefile.win [Build Error] [Objects/MingW/MenuSampleFrm.o] Error 1

If I use version 7.3 it compile without an error and I can’t see any difference in the code generated by both versions.
I did delete version 7.4.1 and download it again in case there was a problem during the download process.
I will appreciate it if someone can help me to correct it.I attached the complete MenuSamplefrm.cpp file.
Attachments
MenuSamplefrm.cpp file.txt
(2.35 KiB) Downloaded 179 times
tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Re: Loading an icon in a wxmenubar

Post by tbreina »

It's telling you that it can't find the XPM file in the subdirectory Images ( Images/MenuSampleFrm_ID_MNU_ITEMWITHPICTURE_1003_XPM.xpm). I've been working on this and found that for some reason the IDE is no longer generating the XPM files. For the present, you can either (1) use the native image or (2) copy the Images/MenuSampleFrm_ID_MNU_ITEMWITHPICTURE_1003_XPM.xpm from your 7.3 project to your 7.4 project.

-Tony
Everybody's got something to hide except for me and my monkey.
tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Re: Loading an icon in a wxmenubar

Post by tbreina »

As a followup, it looks like the XPM function is having trouble if the Images directory doesn't exist. So, for now, if you can manually create the "Images" subdirectory under your new project's main directory, then the IDE should be able to generate the XPM correctly.

I should have a new release soon (just fixing this bug and a few others).

-Tony
Everybody's got something to hide except for me and my monkey.
Egros
In need of some credit
In need of some credit
Posts: 2
Joined: Sat Feb 11, 2012 4:06 pm

Re: Loading an icon in a wxmenubar

Post by Egros »

Tony thank you for your quick reply I appreciate it.
Post Reply