MyAlbum   Pet
DirectX   openGL   Java   C/C++   STL   C#   Python   Window   ActiveX   SE & Refactoring   Game   Unicode   googleDesktop   Network   Database   Web   php   asp   asp.net   Library   QT   wxWidget   Something to read  
ToDo
zelon's WebAlbum
Google Tools
Google Naver map
ToRearrange
OpenOffice.org
Eclipse
Check W3 validator
wxwidget
e i R f
Anonymous

Contents

1 About wxWidget
2 wxpack
3 각 플랫폼에서 컴파일하기
4 HelloWorld 예제
5 참고 링크

1 About wxWidget #

wxwidget 은 하나의 코드로 여러 OS 에서 GUI 프로그래밍을 위한 툴킷이다. 하지만 OS 에 의존적인 다른 부분들(네트웍, 쓰레드등)의 작성도 도와준다.

  • 공식 홈페이지 : http://www.wxwidgets.org/
  • 2 wxpack #


    • http://wxpack.sourceforge.net

      wxwidget 은 기본적으로 소스 차원에서 배포되고, 자신의 컴퓨터에서 빌드를 해서 라이브러리 파일들을 구축하는 데, 이 wxpack 은 MinGW, VC++ 에 맞게 빌드된 바이너리를 가지고 있는 것 같다. 그리고 VC++ 7.0 ~ 8.0 까지의 개발환경과의 통합도 지원하는 듯. 나중에 한번 구축해봐야겠다. 잘 하면 이 한방에 개발환경이 만들어질 듯.

    3 각 플랫폼에서 컴파일하기 #


    4 HelloWorld 예제 #

    wxWidgetSample.png

    아래의 코드를 입력하면 위와 같은 프로그램을 만들 수 있다.

    /*
     * hworld.cpp
     * Hello world sample by Robert Roebling
     */
    
    #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()
    
    IMPLEMENT_APP(MyApp)
    
    bool MyApp::OnInit()
    {
        MyFrame *frame = new MyFrame( _T("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((wxFrame *)NULL, -1, title, pos, size)
    {
        wxMenu *menuFile = new wxMenu;
    
        menuFile->Append( ID_About, _T("&About...") );
        menuFile->AppendSeparator();
        menuFile->Append( ID_Quit, _T("E&xit") );
    
        wxMenuBar *menuBar = new wxMenuBar;
        menuBar->Append( menuFile, _T("&File") );
    
        SetMenuBar( menuBar );
    
        CreateStatusBar();
        SetStatusText( _T("Welcome to wxWindows!") );
    }
    
    void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
    {
        Close(TRUE);
    }
    
    void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
    {
        wxMessageBox(_T("This is a wxWindows Hello world sample"),
            _T("About Hello World"), wxOK | wxICON_INFORMATION, this);
    }
    
    
    


    5 참고 링크 #