User forums > Using Code::Blocks
create and use icons with resources
MoonKid:
I have never worked with rc-files.
I just want to link (pack) my ico-files into the binary and use them then. How can I include a ico-file in the rc-file and reference it in my application?
Biplab:
Create a resource file, e.g., resource.rc and add it to your project.
If you want to add an Icon for your application, then add a line to the resource file similar to the following.
--- Code: ---aMAIN ICON "<Path_To_Your_Icon>/<Icon_File_Name>.ico"
--- End code ---
Now compile your project and your application will have the icon You've specified.
Regards,
Biplab
MoonKid:
--- Quote from: Biplab on March 27, 2007, 08:19:06 am ---Now compile your project and your application will have the icon You've specified.
--- End quote ---
Ok, but how can I adress it in my code?
For example:
How can I create a wxIcon object?
Biplab:
--- Quote from: MoonKid on March 27, 2007, 06:15:18 pm ---Ok, but how can I adress it in my code?
For example:
How can I create a wxIcon object?
--- End quote ---
Create a sample wxWidgets Project using Wizard of C::B and look into app.cpp file and resource.rc file. You'll understand how it can be implemented. :)
Regards,
Biplab
MoonKid:
Hm... So easy! ;)
I am not sure If I understand the wx-doc right. Is it only under windows and os2 possible to use resources?
How can I pack ico-files to my binary in unix/linux or mac os x applications?
Navigation
[0] Message Index
[#] Next page
Go to full version