I'd like to produce real-time graphical output from a piece of code using a class derived from wxPanel, with drawing using wxBufferedPaintDC from within the wxPanel::OnPaint. I got this working very well with calls to:
Code: Select all
My current solution to this was to run the state update from within a wxThread, and to call my Redraw method to update the view from within the thread. For reasons that are currently unclear to me, the call to wxWindow::Update() produces a run-time error:
The best current workaround I have is to comment out the call to wxWindow::Update(). This works to a point. I am finding that sometimes the graphics fail to update, but the code runs in the background.** (wxgraphicaloutput:11015): WARNING **: 17:26:57.095: (../atk-adaptor/bridge.c:993):atk_bridge_adaptor_init: runtime check failed: (root)
wxgraphicaloutput: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
I've included a simple bool flag to the creation of the wxThread to prevent more than one running at a time, but this doesn't fix the situation. I am at a loss, and hope you can help before I conclude that wxWidgets does not contain the functionality I've found Java provide very easily with its JPanel, Graphics, BufferedImage and Thread classes.
I am happy to post further code examples, but didn't know what parts of this system you'd like to see - there are several classes derived from the wxWidgets framework.