I’m writing an application where the code is responsible for creating the UI display on the fly. I do this by creating an image and attaching it to a button that’s the size of the window. That’s working just fine. My issue is that I have a separate thread from the thread that’s executing PtMainLoop that receives data and then triggers an update of the button widget. I’m using PtDamageExtent on the button widget and am getting a segmentation fault.
I know that the basic image rendering works correctly because I can cover and uncover the window and my image is drawn correctly. It’s only when I try and call PtDamageExtent to trigger the update from the other thread that I hit the fault. Since the documentation says No under safety for PtDamageExtend, I’m guessing that it’s not safe to call from other threads than the one running PtMainLoop.
Looking through the docs, it appears that most of the Ptxxx calls aren’t safe to invoke from other threads. So my question is what’s the proper way to trigger a display update from a separate thread? I’m guessing that I need to send a message to the PtMainLoop but haven’t figured out what/how yet.
Any help would be greatly appreciated.