News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

create and use icons with resources

Started by MoonKid, March 27, 2007, 06:33:57 AM

Previous topic - Next topic

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.
aMAIN ICON "<Path_To_Your_Icon>/<Icon_File_Name>.ico"

Now compile your project and your application will have the icon You've specified.

Regards,

Biplab
Be a part of the solution, not a part of the problem.

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.

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?

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
Be a part of the solution, not a part of the problem.

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?

Biplab

I've not tried in other platforms.

Download the following ebook.
h**p://www.phptr.com/content/images/0131473816/downloads/0131473816_book.pdf

Read the APPLICATION INSTALLATION sub-chapter in chapter 20. There are couple of hints on how to use icons in Linux. Hope it'll help you. :)
Be a part of the solution, not a part of the problem.

MoonKid

Quote from: Biplab on March 27, 2007, 07:09:21 PM
Read the APPLICATION INSTALLATION sub-chapter in chapter 20. There are couple of hints on how to use icons in Linux. Hope it'll help you. :)

Ok, the crux of it for me: Do not use a plattform specific icon-handling like rc-files. I should add icons as extern ico-files to my application. ;)