Dear support,
I'm trying to work with these data structures inside the grlib_demo program.
I'm currently changing the function "OnButtonPress", just for testing purposes.
It seems to me that, while "CanvasImageSet" can be called and updated just with "WidgetPaint", the same doesn't happen to CanvasOutlineOn/Off and CanvasTextSet, is that so?
void OnButtonPress(tWidget *psWidget) { uint32_t ui32Idx; // // Find the index of this push button. // for(ui32Idx = 0; ui32Idx < NUM_PUSH_BUTTONS; ui32Idx++) { if(psWidget == (tWidget *)(g_psPushButtons + ui32Idx)) { break; } } // // Return if the push button could not be found. // if(ui32Idx == NUM_PUSH_BUTTONS) { return; } // // Toggle the state of this push button indicator. // g_ui32ButtonState ^= 1 << ui32Idx; // // Change text from "auto" to "etc" // CanvasTextSet(g_psPushButtonIndicators + 7, "etc"); WidgetPaint((tWidget *)(g_psPushButtonIndicators + 7)); // // Set the matching indicator based on the selected state of the check box. // CanvasImageSet(g_psPushButtonIndicators + ui32Idx, (g_ui32ButtonState & (1 << ui32Idx)) ? g_pui8LightOn : g_pui8LightOff); WidgetPaint((tWidget *)(g_psPushButtonIndicators + ui32Idx)); }
The update is realized when I remove the panel using WidgetRemove, and add it once again with WidgetAdd. Am I doing something wrong, or is it supposed to work in that way?
It is clear to me that a possible workaround for this would be creating images and using "CanvasImageSet", but I'd like to know if there's an easier and possibly more efficient way to do it.
Thanks in advance!
Best regards,
Gustavo Wegher