title: C++ WxWidgets: Redirecting Stdout to a wxTextCtrl across mulitple threads
body: <p>My application is a multi threaded app (using wxThreads). At the moment, the main thread along with it's child worker threads are outputting various messages to Stdout (using cout).</p>
  
  <p>I have a new frame/window with a wxTextCtrl, and would like to redirect all the StdOut messages in to it.  </p>
  
  <pre>
  GuiLogFrame         *logframe;
  
  logframe = new GuiLogFrame(NULL, wxID_ANY, wxEmptyString);
  logframe->Show();
  
  logredirector = new wxStreamToTextRedirector(logframe->get_log_textctrl());
  </pre>
  
  <p>This doesn't work. But if I replace the last line</p>
  
  <pre>
  wxStreamToTextRedirector redir(logframe->get_log_textctrl());
  </pre>
  
  <p>The standard out will be redirected to the logframe wxTextCtrl as long as redir is in scope... I want it to stay even when it goes out of scope. </p>
  
  <p>What I want is the wxStreamToTextRedirector to stay intact the entire time the application is running... so even the new thread's cout will also redirect in to the same wxTextCtrl. </p>
  
  <p>Any thoughts?</p>