Can anyone help to draw rectangle in wxwidgets because i have written a code but it doesn't work it only displays a window frame :     #include "wx/wx.h"
    
    class MyFrame : public wxFrame{
       public:
           MyFrame();
           ~MyFrame();
        private:
           //DECLARE_EVENT_TABLE()
    };
    
    class MyWindow : public wxWindow{
       public:
        void OnPaint(wxPaintEvent& event);
        private:
          DECLARE_EVENT_TABLE()
    };
    
    class MyApp : public wxApp
    {
        public:
           MyApp();
           ~MyApp();
           virtual bool OnInit();
            void DrawSimpleShapes(wxDC& dc);
        private:
           MyFrame* m_frame = NULL;
           //MyWindow* w = NULL;
    };
    
    MyFrame::MyFrame() : wxFrame(nullptr,wxID_ANY,"Rectangle",wxPoint(30,30),wxSize(800,600))
    {
    
    }
    
    bool MyApp :: OnInit()
    {
       m_frame = new MyFrame();
       m_frame->Show();
       //w = new MyWindow();
       //w->Show();
       return true;
    }
    wxIMPLEMENT_APP(MyApp);
    wxBEGIN_EVENT_TABLE(MyWindow,wxWindow)
       EVT_PAINT(MyWindow::OnPaint)
    wxEND_EVENT_TABLE()
    MyFrame::~MyFrame()
    {
    
    }
    
    MyApp::MyApp()
    {
    
    }
    
    MyApp::~MyApp()
    {
    
    }
    
     void MyWindow :: OnPaint(wxPaintEvent& event)
     {
        wxPaintDC dc(this);
        dc.SetPen(*wxBLACK_PEN);
        dc.SetBrush(*wxRED_BRUSH);
        wxSize sz = GetClientSize();
        wxCoord w = 100, h = 50;
        int x = wxMax(0,(sz.x-w)/2);
        int y = wxMax(0,(sz.y - h)/2);
        wxRect recToDraw(x,y,w,h);
        dc.DrawRectangle(recToDraw);
     }

 1. List item

how to draw a rectangle 
some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem 
some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem 
some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem 
some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem 
some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem 
some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem 
some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem 
some guide to learn wxwidgets
what's the problem with my code
please explain the problem
when i run this code it does not print any rectangle instead it just print window only
that's why i am unable to print rectangle
I am new to wxwidgets library so it is difficult for me to find any error 
i cannot do any error handling in the wxwidgets so  please help to resolve this problem 
