Hi,
My application implements, among many other GUI components, a global data storage class with numerous properties. I intend to access this class by means of an 'autoobject' from numerous other GUI components.
Reading and writing from/to the data objects works fine. In addition, I need to react to changes of the properties, and this is what I haven't found a solution for so far.
My idea was to attach an observer to the property, but this does not work out.
The code in init() is as follows:
attachobserver SlotMethod, ^UI::Data.Property;
In the OnSet method of the property, the observer is notified as follows:
if ( pure Property == value )
return;
pure Property = value;
notifyobservers ^Property;
In the prototyper, this gives unstable results (sometimes working, sometimes not), and on the target (STM32F769-Discovery board) it does not work at all.
I have read the following article and downloaded the example:
https://doc.embedded-wizard.de/implementing-component-interface?v=8.30#5
The downloaded example obviously works, but I am not sure how to apply the concept given to notify a GUI component upon change of a property?