The first wxWidgets program:Hello world!
来源:互联网 发布:中班美工剪纸 编辑:程序博客网 时间:2024/06/10 17:13
#include "wx/wx.h"
class MyApp: public wxApp
{
virtual bool OnInit();
};
class MyFrame: public wxFrame
{
public:
MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
enum
{
ID_Quit = 1,
ID_About,
};
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(ID_Quit, MyFrame::OnQuit)
EVT_MENU(ID_About, MyFrame::OnAbout)
END_EVENT_TABLE()
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame( _("Hello World"), wxPoint(50, 50), wxSize(450, 340) );
frame->Show(true);
SetTopWindow(frame);
return true;
}
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame(NULL, -1, title, pos, size)
{
wxMenu *menuFile = new wxMenu;
menuFile->Append( ID_About, _("&About...") );
menuFile->AppendSeparator();
menuFile->Append( ID_Quit, _("E&xit") );
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append( menuFile, _("&File") );
SetMenuBar( menuBar );
CreateStatusBar();
SetStatusText( _("Welcome to wxWidgets!") );
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close(true);
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxMessageBox( _("This is a wxWidgets Hello world sample"),
_("About Hello World"),
wxOK | wxICON_INFORMATION, this );
}
IMPLEMENT_APP(MyApp)
class MyApp: public wxApp
{
virtual bool OnInit();
};
class MyFrame: public wxFrame
{
public:
MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
enum
{
ID_Quit = 1,
ID_About,
};
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(ID_Quit, MyFrame::OnQuit)
EVT_MENU(ID_About, MyFrame::OnAbout)
END_EVENT_TABLE()
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame( _("Hello World"), wxPoint(50, 50), wxSize(450, 340) );
frame->Show(true);
SetTopWindow(frame);
return true;
}
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame(NULL, -1, title, pos, size)
{
wxMenu *menuFile = new wxMenu;
menuFile->Append( ID_About, _("&About...") );
menuFile->AppendSeparator();
menuFile->Append( ID_Quit, _("E&xit") );
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append( menuFile, _("&File") );
SetMenuBar( menuBar );
CreateStatusBar();
SetStatusText( _("Welcome to wxWidgets!") );
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close(true);
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxMessageBox( _("This is a wxWidgets Hello world sample"),
_("About Hello World"),
wxOK | wxICON_INFORMATION, this );
}
IMPLEMENT_APP(MyApp)
- The first wxWidgets program:Hello world!
- I. Writing the "Hello world" program
- "Hello world" ,frist program
- Hello World! first article
- 1.Hello World!——start from the first class.
- The first QT Program !
- The first GTK+ Program
- The first C++ program
- The first C# program
- Starting your first golang program. 编写golang程序的"Hello World!"
- 《算法》第四版 Your First Java Program: Hello World——exercise 记录
- wxWidgets学习笔记之1:“hello,world”
- JFinal First Demo "Hello World"
- Hello the world
- Hello the World
- Hello the curel world!
- Hello World C program using Android Toolchain
- The Wonderful World of wxWidgets 3.0
- 在 Asp.NET MVC 中使用 SignalR 实现推送功能
- 所有元素最大值。
- 【Tech-Android-View】android中ViewGroup中onMeasure()方法
- Dicom Image Viewer for iPad
- 在iOS平台上编译 DCMTK
- The first wxWidgets program:Hello world!
- sqlserver阻塞定位
- 将2乘3的二维数组a的行和列的元素转换,存到一个3乘2的数组里。
- FLEX中使用outerDocument
- Spring获取bean方式(BeanFactory和ApplicationContext)
- 【Tech-Android-Other】Android中有效自定义View的注意事项
- ASP.NET连接数据库
- 微软面试智力题
- 2011斯坦福大学iOS应用开发教程学习笔记(第五课)Protocols,手势识别