App loaded in memory, Window(wxFrame) not displayed
Posted: Mon Jul 13, 2009 4:31 pm
Hi, I'm on windows XP, wxDEV-C++ 6.10.2, wxWidgets 2.8.7:
I'm starting with an empty project, the code compiles ok, it is loaded in memory ( I can see the process in the Taskmanager), but there is no window display. I've going blind looking at the code (listed below). Can anyone see what I am missing? Much appreciated in advance,
jb
-----------------------------------------------------------
#ifndef __BFPC_CPP
#define __BFPC_CPP
#endif
#ifdef __BORLANDC__
#pragma hdrstop
#endif
/* PRE-COMPILER CHECK */
#ifndef WX_PRECOMP
#include <wx/wx.h>
#include <wx/frame.h>
#else
#include <wx/wxprec.h>
#endif
/* End pre-compiler check */
#include <wx/string.h>
#include <wx/menu.h>
#include <string>
#include <iostream>
using namespace std;
class BFPCApp : public wxApp
{
public:
virtual bool onInit();
};
class Chart : public wxFrame
{
public:
Chart(wxWindow *parent,wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size);
virtual ~Chart();
wxMenu *Main,*Search;
private:
DECLARE_EVENT_TABLE()
};
enum
{
IDMain = 2,
IDSearch = 3,
};
BEGIN_EVENT_TABLE(Chart, wxFrame)
END_EVENT_TABLE()
IMPLEMENT_APP(BFPCApp)
bool BFPCApp::onInit()
{
wxInitAllImageHandlers();
if (wxGetCwd()!="c:/BF Productions/") {wxSetWorkingDirectory("c:/BF Productions/");}
Chart *frame = new Chart(NULL,1,_T("BF Productions"),wxPoint(10,10),wxSize(500,500));
frame->SetBackgroundColour(wxColour(69,139,116)); //aquamarine - change to money shades
frame->Show(true);
SetTopWindow(frame);
return true;
}
Chart::Chart(wxWindow * parent,wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size):
wxFrame((wxFrame *)NULL,1,title,pos,size,wxRESIZE_BORDER | wxCAPTION |
wxSYSTEM_MENU | wxMINIMIZE_BOX | wxCLOSE_BOX)
{
}
Chart::~Chart() {}
I'm starting with an empty project, the code compiles ok, it is loaded in memory ( I can see the process in the Taskmanager), but there is no window display. I've going blind looking at the code (listed below). Can anyone see what I am missing? Much appreciated in advance,
jb
-----------------------------------------------------------
#ifndef __BFPC_CPP
#define __BFPC_CPP
#endif
#ifdef __BORLANDC__
#pragma hdrstop
#endif
/* PRE-COMPILER CHECK */
#ifndef WX_PRECOMP
#include <wx/wx.h>
#include <wx/frame.h>
#else
#include <wx/wxprec.h>
#endif
/* End pre-compiler check */
#include <wx/string.h>
#include <wx/menu.h>
#include <string>
#include <iostream>
using namespace std;
class BFPCApp : public wxApp
{
public:
virtual bool onInit();
};
class Chart : public wxFrame
{
public:
Chart(wxWindow *parent,wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size);
virtual ~Chart();
wxMenu *Main,*Search;
private:
DECLARE_EVENT_TABLE()
};
enum
{
IDMain = 2,
IDSearch = 3,
};
BEGIN_EVENT_TABLE(Chart, wxFrame)
END_EVENT_TABLE()
IMPLEMENT_APP(BFPCApp)
bool BFPCApp::onInit()
{
wxInitAllImageHandlers();
if (wxGetCwd()!="c:/BF Productions/") {wxSetWorkingDirectory("c:/BF Productions/");}
Chart *frame = new Chart(NULL,1,_T("BF Productions"),wxPoint(10,10),wxSize(500,500));
frame->SetBackgroundColour(wxColour(69,139,116)); //aquamarine - change to money shades
frame->Show(true);
SetTopWindow(frame);
return true;
}
Chart::Chart(wxWindow * parent,wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size):
wxFrame((wxFrame *)NULL,1,title,pos,size,wxRESIZE_BORDER | wxCAPTION |
wxSYSTEM_MENU | wxMINIMIZE_BOX | wxCLOSE_BOX)
{
}
Chart::~Chart() {}