1.3k views
in GUI Development by
I have three widges on my screen. One "Steel::HorzSlider" one "Flat::DigitalDisplay" and one "Flat::AnalogDisplay".

A property int32 "MY_Value_01" is connected to all three "Outlet" slots from the widgets.

After running the application, i can change the slider and the displays show the value from the slider.

Now i want to change the value from the property "MY_Value_01" by touching a "Simple Touch Handler". The "Simple Touch Handler" is connected to a "Slot Method". In this method, i wrote : "MY_Value_01 = 5";

If i touch the Handler, i can reach a breakpoint in the Slot Method from the Touch Handler, but the Display dont change to Value 5 :-(

What i have to do to update the value in all displays and widgets ?

1 Answer

0 votes
by

Dear Michael,

All outlets within our read-2-use widget sets follow the outlet pattern. By changing an assigned property all attached widgets get notified that the corresponding property has been changed. If you are now changing the property value from another component, e.g. from your SlotMethod, then you just have to tell everyone attached to this property, that this value has been changed. Therefore just invoke

notifyobservers ^My_Value_01;

after you have assigned the property value within your SlotMethod.

Alternatively you could also extend the corresponding OnSetMethod of your property in order to call notifyobservers after remembering the new value, e.g.

pure My_Value_01 = value;
notifyobservers ^My_Value_01;

Please have a look at our online knowledge base for further information: http://doc.embedded-wizard.de/notifyobservers-statement

Does this help?

Best regards,
Manuel

by
Thank you. It works fine

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...