Re: [Dev-C++] re: Help with GUI tool Please
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: softnasolutions-ltd.fsbusiness.co.uk <so...@so...> - 2001-02-11 09:21:38
|
Please find below the complete program as it stands. The errors i get are
linker errors and they all have to do wiyh undefined reference; Do i have to
do any thing under project/options ?
Thanks in advance !!.
------------------------------------------------------
#include <iostream.h>
#include <stdlib.h>
#include <windows.h>
#define __WXMSW__
#define __GNUWIN32__
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
// The main Application
class MainApp: public wxApp
{
public:
virtual bool OnInit();
};
// The main Window
class MainWindow: public wxFrame
{
public:
// Constructor
MainWindow(const wxString &title, const wxPoint &pos, const wxSize
&size);
// Event handler (should *NOT* be virtual!)
void OnQuit(wxCommandEvent &event);
private:
// Any class wishing to process wxWindows events must use this macro
DECLARE_EVENT_TABLE()
};
// IDs for the menu command
enum
{
MainWin_Quit = 1
};
BEGIN_EVENT_TABLE(MainWindow, wxFrame)
EVT_MENU(MainWin_Quit, MainWindow::OnQuit)
END_EVENT_TABLE()
IMPLEMENT_APP(MainApp)
// Implementation
// Main Application
bool MainApp::OnInit()
{
MainWindow *win = new MainWindow("Window", wxPoint (100, 100),
wxSize(450, 340));
win->Show(TRUE);
SetTopWindow(win);
/* Do not return FALSE or the app will terminate immediately */
return TRUE;
}
// Main Window
MainWindow::MainWindow(const wxString &title, const wxPoint &pos, const
wxSize &size)
: wxFrame((wxFrame *) NULL, -1, title, pos, size)
{
wxMenu *FileMenu = new wxMenu;
wxMenuBar *MenuBar = new wxMenuBar;
// create a menu bar
FileMenu->Append(MainWin_Quit, "&Quit");
// Add it to the menu bar
MenuBar->Append(FileMenu, "&File");
SetMenuBar(MenuBar);
// Create the status bar
CreateStatusBar(2);
SetStatusText("Hello World!");
}
void MainWindow::OnQuit(wxCommandEvent & WXUNUSED(event))
{
// Force the window to close
Close(TRUE);
}
---------------------------------------------
NAPOLEON.
#
----- Original Message -----
From: "Stuart Gilberd" <stu...@pa...>
To: "Dev C++ Mailing List" <dev...@li...>
Sent: Saturday, February 10, 2001 7:22 PM
Subject: [Dev-C++] re: Help with GUI tool Please
> Perhapes you could mention what errors you are getting. I am using
> wxWindows. What is your simple program?
>
>
>
> THIS IS THE SECOND TIME I AM SENDING THIS MAIL. PLEASE HELP SOMEONE.
|