I'm creating a wxSplitterWindow that contains 2 custom widgets: the first is derived from wxPanel and the second is derived from wxGLCanvas...
If I add both the widgets at the splitter I obtain an error:
Code: Select all
assert "window->MacGetCGContextRef() != __null" failed in wxPaintDCImpl(): using wxPaintDC without being in a native paint event
exaple, this does cause the error:
Code: Select all
[...]
auto *splitView = new wxSplitterWindow(
splitView,
wxID_ANY,
wxDefaultPosition,
wxDefaultSize,
wxSP_LIVE_UPDATE | wxSP_3D
);
auto *viewer2D = new Viewer2D(splitView, wxID_ANY );
auto *viewer3D = new Viewer3D(splitView, wxID_ANY);
splitView->SplitHorizontally(viewer, scheme);
[...]
Code: Select all
[...]
auto *splitView = new wxSplitterWindow(
splitView,
wxID_ANY,
wxDefaultPosition,
wxDefaultSize,
wxSP_LIVE_UPDATE | wxSP_3D
);
auto *viewer2D = new Viewer2D(splitView, wxID_ANY );
auto *viewer3D = new wxPanel(splitView, wxID_ANY);
splitView->SplitHorizontally(viewer, scheme);
[...]
Code: Select all
[...]
auto *splitView = new wxSplitterWindow(
splitView,
wxID_ANY,
wxDefaultPosition,
wxDefaultSize,
wxSP_LIVE_UPDATE | wxSP_3D
);
auto *viewer2D = new wxPanel(splitView, wxID_ANY );
auto *viewer3D = new Viewer3D(splitView, wxID_ANY);
splitView->SplitHorizontally(viewer, scheme);
[...]
EDIT: If I use wxCliendDC in the paint event handlers all works fine, but I can't understand why