Hello,
Apologies upfront for noob question. I've been using widgets on Windows and Linux for more than a few year. Just recently wanted to get into OSX. I'm having a hell of a time figuring out how to call the icns file once its part of my app bundle. There are no MWEs, at least that I saw, that show something to the effect of
MyToolBar->AddTool(MENU_FILTER_UNDO,_T("undo"),wxICON(undo));
for an icon imported on Windows as #include "resources/undo.xpm"
I've tried calling the icns directly, included in my osx folder, like this SetIcon(wxIcon("takeTwo.icns")); While there are no errors, it doesn't do anything. Ultimately, I just want to use the icns files as icons on the frame to link to events.
Thanks for any help.
Once I have an icns file in plist, how do I use it?
Re: Once I have an icns file in plist, how do I use it?
Hi,
Welcome to the wonderful world of OSX.
Did you try and build the 'minimal' sample under OSX?
It does have both a Makefile and XCode project (empty one).
Thank you.
Welcome to the wonderful world of OSX.
Did you try and build the 'minimal' sample under OSX?
It does have both a Makefile and XCode project (empty one).
Thank you.
Re: Once I have an icns file in plist, how do I use it?
Thanks for the suggestion. I did make the toolbar sample which DOES have icons in the toolbar but it uses XPM Bitmaps. That solution is fine for now and I've been able to get that to work in other applications but I still don't have a sense for how the plist and ICNS file works to place the icon on the toolbar.
Re: Once I have an icns file in plist, how do I use it?
I don't work under OSX, so i can't test any of this, but you should try wxIcon::LoadFile() with type = wxBITMAP_TYPE_ICON_RESOURCE.
Looking at the source in <wxdir>/src/carbon/icon.cpp it seems like this tries to find the icon in the app bundle.
Looking at the source in <wxdir>/src/carbon/icon.cpp it seems like this tries to find the icon in the app bundle.
Use the source, Luke!