Thread: [Dev-C++] re: Help with GUI tool Please
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Stuart G. <stu...@pa...> - 2001-02-10 19:22:45
|
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. ----- Original Message ----- From: softnasolutions-ltd.fsbusiness.co.uk To: dev...@li... Sent: Thursday, February 08, 2001 10:07 PM Subject: [Dev-C++] Help with GUI tool Please Hi all, I want to learn a GUI tool to interface my C++ programs but so far i just can't get any to work with Dev C++ . I have tried wxWindows and Gtk+ which comes with Dev C++ to no avail. I get errors when i compile the smallest program. Can someone tell me which GUI tool(s) they are using in Dev C++ and how i can do likewise in my. Please help ! Napoleon. |
|
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.
|
|
From: Stuart G. <stu...@pa...> - 2001-02-11 18:23:41
|
Try creating a new project using new project, GUI toolkit, wx windows, Now have a look at project options, the extra options there should always be there for any wxwindows project. > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of > softnasolutions-ltd.fsbusiness.co.uk > Sent: Sunday, 11 February 2001 10:22 p.m. > To: dev...@li... > Subject: Re: [Dev-C++] re: Help with GUI tool Please > > > 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. > > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: softnasolutions-ltd.fsbusiness.co.uk <so...@so...> - 2001-02-11 21:23:11
|
Thanks a lot Staurt, I did as i instructed and it worked. I got my hello world program to compile. One more thing what do you think is the best way for me to go about learning wxwindows. Any tutorials or books ? Thanks again. ----- Original Message ----- From: "Stuart Gilberd" <stu...@pa...> To: <dev...@li...> Sent: Sunday, February 11, 2001 6:23 PM Subject: RE: [Dev-C++] re: Help with GUI tool Please > Try creating a new project using new project, GUI toolkit, wx windows, Now > have a look at project options, the extra options there should always be > there for any wxwindows project. > |