I have written an example with PtColorWell widget on PhAB, QNX 6.3.3.
I used a PtColorWell widget to change color of a PtRect, so I write a callback with event Pt_CS_COLOR_CHANGED, its name ColorChange() as below.
And calling it in the PtColorWell 's callback function:
int ColorChange( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo)
{
mau= getcolor( widget, Pt_ARG_CS_COLOR );
// get the changed color to the variable mau
PtSetResource( ABW_PtRect1, Pt_ARG_FILL_COLOR, mau, 0);
// set this color to anothe widget
}
Hi maschoen, I have changed my code as you said, but it caused a SIGSEGV signal on that code line.
This happends on any codes with variable *mau, evently in debugging with printf() function.
printf("%ld", *mau);
…Is something wrong?
[/quote]
I forgot to mention. I initialized mau when I first saw the SIGSEGV. Actually, the way you are doing things is rather strange. You update the color picker and the rectangle colors asynchronously. You update the rectangle in a timer widget call. This is strange and unnecessary. At the very least you should keep the color in a global variable instead of mau. But I would update the rectangle when the color picker call is completed. That’s the obvious solution.
Thank you for your interest. The PtTimer I used as an example when looking for a solution to PtColorWell only.
I also found and corrected errors in the PtColorWell color change callback as above post.