Need help on a simple example

Help
Kdoo
2009-06-09
2013-05-02
  • Kdoo
    Kdoo
    2009-06-09

    I've poked around looking for a solution to my problem to no avail.  I have a wxFrame that includes a wxNotebook with multiple tabs.  I want to include a mpWindow within a notebook tab.  I am opting not to use a sizer as I have manually placed other wxwidgets using a form editor.  When I run my code, the mpWindow displays on the screen in the correct notebook tab.  However, I keep getting this error over and over again in a dialog box:

    [mpWindow::OnPaint] vis.area:596x396 px=0 py=0

    The error will keep displaying even if i hit okay unless I drag the dialog box away from the mpWindow (it creates a new dialog box on top of the mpWindow upon close).

    The code is relatively simple but there may be some conflict with events or some other intricacies that I am unaware of.  (One of my other tabs has a wxglcanvas but I don't think that is the issue as it still displays the error with the wxglcanvas disabled)

    Here's my code snippet:

    /* Code is within a subclass of a wxFrame in the constructor */

    //Configure is an individual wxNotebook tab
    mpWindow* m_histogram = new mpWindow( Configure, -1, wxPoint(0,0), wxSize(600,400), wxSUNKEN_BORDER );
        mpScaleX* xaxis = new mpScaleX(wxT("X"), mpALIGN_BOTTOM, false, mpX_NORMAL);
        mpScaleY* yaxis = new mpScaleY(wxT("Y"), mpALIGN_LEFT, false);
    //Is SetScr needed here? I added it to mess around but it didn't help
        m_histogram->SetScr(596, 396);
        m_histogram->AddLayer( xaxis );
        m_histogram->AddLayer( yaxis );

    Any help would be appreciated as I am about to go crazy considering this isn't all that conceptually difficult by any means.

    I'm just trying to get a graph to display without constantly triggering error dialog boxes.

    Thanks,
    Kevin

     
    • cdron77
      cdron77
      2009-06-09

      It is not an error: it is only a debug output. Probably I forgot to disable it in some release of wxMathPlot. Just comment out the line 24 of mathplot.cpp (#define MATHPLOT_DO_LOGGING) and rebuild wxMathPlot

      For next releases this define will be stripped out of the code and defined through CMake.

      CD-RON77

       
    • Kdoo
      Kdoo
      2009-06-09

      Ah, Thanks.  That explains a lot haha.