bool TestFrameIconApp::OnInit()
{
TestFrameIconFrame* frame = new TestFrameIconFrame(0L, _("wxWidgets Application Template"));
frame->SetIcon(wxICON(aaaa)); // To Set App Icon //AND THIS PIECE OF CODE WAS NOT THERE IN MY CASE
frame->Show();
return true;
}
Thank you very much for solving the problem in simple and elegant way. The piece of code was not there in my "...App.cpp" but instead it was inserted by wxSmith in "...Main.cpp", which I posted earlier. Inserting the line of code by hand in my "...App.cpp" solved all my problem like magic.
My generated code was "myIconTestApp.cpp":
#include "myIconTestApp.h"
//(*AppHeaders
#include "myIconTestMain.h"
#include <wx/image.h>
//*)
IMPLEMENT_APP(myIconTestApp);
bool myIconTestApp::OnInit()
{
//(*AppInitialize
bool wxsOK = true;
wxInitAllImageHandlers();
if ( wxsOK )
{
myIconTestFrame* Frame = new myIconTestFrame(0);
Frame->SetIcon(wxICON(aaaa)); // this was inserted and everything worked fine
Frame->Show();
SetTopWindow(Frame);
}
//*)
return wxsOK;
}
So question is
#why this line of code was not generated automatically when wxSmith was used?
#why do wxSmith inserted wxFrame->SetIcon("someicon.ico") in "...Main.cpp" instead of "...App.cpp"?
#why SetIcon in "...Main.cpp" is not working while another way around is?
Well... this will be another topic of discussion (or newbie like me needs some learning to do) but my problem in hand is solved.
Thank you very much and Regards!