title: wxWidgets: can't inherit from wxListCtrl
body: <p>I have a freeze problem with the following code: (EBCFrame is an inherited class (wxFrame). Look for the "else" part, thank you)</p>
  
  <pre><code>void EBCFrame::OnOpen(wxCommandEvent&amp; event)
  {
      int error = 0;
      _window = new wxScrolledWindow(this, wxID_ANY, wxPoint(0, 0), wxSize(600, 400), wxVSCROLL|wxHSCROLL);
  
      wxFileDialog* fileDialog = new wxFileDialog(this, wxT("Select a file"), wxEmptyString, wxEmptyString, wxT("Event Bus configuration file (*.ebf)|*.ebf|Txt|*.txt|All|*"));
      if(fileDialog-&gt;ShowModal() == wxID_OK)
      {
          //taking the file's name we want to process
          wxString tempfilename;
          tempfilename += fileDialog-&gt;GetPath();
          //need to convert to const char*
          char* filename = new char[tempfilename.length()];
          strncpy(filename, (const char*)tempfilename.mb_str(wxConvUTF8), tempfilename.length() - 1);
          //done
  
          _handler-&gt;Read(filename);
          //processing it
          error = _handler-&gt;GetError();
          if(error != 0)  //an error has occoured
          {
              wxMessageDialog dialog( NULL,  wxT("An error has occoured: " + wxString::FromAscii(strerror(error))), wxT("Error"), wxOK|wxICON_ERROR);
              dialog.ShowModal();
          }
          else
          {
              // Create a list in report mode
              EBCList* list = new EBCList();
              // it works instead
              //wxListCtrl* list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(400, 400),wxLC_REPORT|wxLC_SINGLE_SEL);
              // even if I delete the following code, and I leave only the first code line in the else section, it still freezes
              // Insert two columns
              wxListItem itemCol;
              itemCol.SetText(wxT("Param"));
              itemCol.SetImage(-1);
              itemCol.SetAlign(wxLIST_FORMAT_CENTRE);
              list-&gt;InsertColumn(0, itemCol);
              list-&gt;SetColumnWidth(0, wxLIST_AUTOSIZE );
              itemCol.SetText(wxT("Value"));
              itemCol.SetAlign(wxLIST_FORMAT_CENTRE);
              list-&gt;InsertColumn(1, itemCol);
              list-&gt;SetColumnWidth(1, wxLIST_AUTOSIZE );
              // Insert ten items
              for ( int i = 0; i &lt; 5; i++ )
              {
                  wxString buf;
                  // Insert an item, with a string for column 0,
                  buf.Printf(wxString::FromAscii(_handler-&gt;GetAttributeName(i + 1).c_str()), i);
                  list-&gt;InsertItem(i, buf);
                  // The item may change position due to e.g. sorting,
                  // so store the original index in the item’s data
                  list-&gt;SetItemData(i, i);
                  // Set a string for column 1
                  buf.Printf(wxString::FromAscii(_handler-&gt;GetAttribute(i + 1).c_str()), i);
                  list-&gt;SetItem(i, 1, buf);
              }
          }
          _window-&gt;Show(true);
      }
  }
  </code></pre>
  
  <p>Here's the header and the cpp file of the EBCList class. Header:</p>
  
  <pre><code>#ifndef EBCLIST_H
  #define EBCLIST_H
  #include &lt;wx/listctrl.h&gt;
  #include &lt;wx/menu.h&gt;
  
  enum LIST_ENUM
  {
      wxLIST_CTRL = 1000,
      wxLIST_CTRL_EDIT
  };
  
  class EBCList : public wxListCtrl
  {
      public:
          EBCList();
          ~EBCList();
  
          void OnActivated(wxListEvent&amp; event);
          void OnRightClick(wxMouseEvent&amp; event);
  
      private:
      // This class handles events
      DECLARE_EVENT_TABLE()
  };
  
  #endif // EBCLIST_H
  </code></pre>
  
  <p>Cpp:</p>
  
  <pre><code>#include "EBCList.h"
  
  EBCList::EBCList() : wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(400, 400),wxLC_REPORT|wxLC_SINGLE_SEL)
  {
  }
  
  EBCList::~EBCList()
  {
  }
  
  void EBCList::OnActivated(wxListEvent&amp; event)
  {
  
  }
  
  void EBCList::OnRightClick(wxMouseEvent&amp; event)
  {
      int flags;
      long subitem;           /* used by HitTest */
      long key = HitTest(event.GetPosition(), flags, &amp;subitem);
  
      wxMenu menu;
      wxPoint pos;
      pos = event.GetPosition();
      menu.Append(wxLIST_CTRL_EDIT, _T("&amp;Edit"));
      PopupMenu(&amp;menu, pos.x, pos.y);
  }
  
  BEGIN_EVENT_TABLE(EBCList, wxListCtrl)
      EVT_LIST_ITEM_ACTIVATED(wxLIST_CTRL, EBCList::OnActivated)
      EVT_RIGHT_DOWN(EBCList::OnRightClick)
  END_EVENT_TABLE()
  </code></pre>
  
  <p>I can't get why the program freezes, since the way I declared EBCList costructor is basically like a 'short-invocation' of the wxListCtrl costructor. Any help is appreciated. Thank you for your support</p>