Wednesday, August 05, 2015

How To Redirect Log from our Event Handlers to wxTextCtrl

class MyFrame : public Frame
{
      protected:
            // Handlers for Frame events.
            void m_button1OnButtonClick( wxCommandEvent& event );
      public:
            /** Constructor */
            MyFrame( wxWindow* parent );
      //// end generated class members

      private:
            wxLog *m_logOld;

};

MyFrame::MyFrame( wxWindow* parent )
:
Frame( parent )
{
    m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_textCtrlLog));
    wxLogMessage( "This is the log window" );

}



0 comments: