Assigning a program icon Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
User avatar
Disch
Experienced Solver
Experienced Solver
Posts: 99
Joined: Wed Oct 17, 2007 2:01 am

Assigning a program icon

Post by Disch »

This seems like such a simple question, but I've been looking all day and I can't find anything that directly addresses it either in the docs, on the wiki, or on these forums (or I'm just doing a bad job of searching -- which is possible).

I want to assign my executable an icon, so that the icon appears in the upper-left corner of the main frame and on the task bar (in Windows), and wherever else appropriate (on other platforms). Having the binary be assigned its own icon when viewed via Explorer (or whatever window manager) would be nice too, but is less important to me.

Currently, on Windows, I just have the generic Windows logo on the main window and in the taskbar (which is the default if you don't assign one).

I have looked at wxTaskBarIcon, but unless I'm misunderstanding, that looks like it's for creating an entry in the system tray, which I am not interested in.

I have searched both wxWindow and wxFrame class outlines for the intuitive "SetIcon" function, but have found nothing of the sort.

Does wx allow for this? If so how can it be accomplished? Note that while I am currently coding on Windows, I am not interested in any solution that is Windows specific (doing OS specific things kind of completely defeats the point of using a lib like wx, IMO).

Thanks in advance.
mc2r
wxWorld Domination!
wxWorld Domination!
Posts: 1195
Joined: Thu Feb 22, 2007 4:47 pm
Location: Denver, Co
Contact:

Post by mc2r »

Look at wxTopLevelWindow::SetIcon()

also you can set the default app on msw by adding this to the a .rc file for the app.

appicon ICON "some_icon.ico"

This thread shows both in use.

http://forums.wxwidgets.org/viewtopic.p ... ation+icon

-Max
User avatar
Disch
Experienced Solver
Experienced Solver
Posts: 99
Joined: Wed Oct 17, 2007 2:01 am

Post by Disch »

mc2r wrote:Look at wxTopLevelWindow::SetIcon()
*feels dumb*

forgot all about wxTopLevelWindow >_<

Ah well, I knew it was something simple. Thanks.
Post Reply