title: New Window wxWidgets
body: <p>I really did search a lot before ask this question. Sorry if it's a simple question.</p>
  
  <p>In my wxWidgets app, I want to new a <code>wxHtmlWindow</code> from a menu choice. (I've already got my main app window showed up correctly).</p>
  
  <p>I set up <code>EVENT_TABLE</code> :</p>
  
  <pre><code>EVT_MENU(wxID_HELP, MyFrame::OnHelp)
  </code></pre>
  
  <p>and then the Function (I got a pointer html_help in the class private):</p>
  
  <pre><code>void MyFrame::OnHelp(wxCommandEvent&amp; event)
  // Callback for the Help menu item
  {
      cout &lt;&lt; "Enter OnHelp" &lt;&lt; endl;
      wxWindow* help_win = new wxWindow(NULL, -1, wxDefaultPosition, wxSize(400, 600));
      cout &lt;&lt; "New window" &lt;&lt; endl;
      help_win-&gt;Show(true);
      cout &lt;&lt; "Show" &lt;&lt; endl;
      html_help = new wxHtmlWindow(help_win, -1);
      cout &lt;&lt; "After new" &lt;&lt; endl;
      wxString m_Name = wxT("help.html");
      //SetTopWindow(html_help);
      bool hel = html_help-&gt;LoadPage(m_Name);
      cout &lt;&lt; "After Loadpage" &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Sorry for the couts. The program throw out segmentation fault after new htmlwindow.</p>
  
  <p>The first time I tried is just new <code>wxHtmlWindow(NULL)</code> with no other wxWindows, but seems not working, the <code>-&gt;LoadPage</code> has segfault . Then I tried <code>new wxHtmlWindow(this)</code>, the <code>htmlwindow</code> showed on current window, not I want .</p>
  
  <p>You may just ignore all the codes, and tell me how to new a wxHtmlWindow (maybe in a new frame? or not) and can actually do the LoadPage work.</p>
  
  <p>Thank you very much!</p>
  
  <p>BTW, I'm using 2.812 wxWidgets, with C++.</p>