270 views
in GUI Development by
Hi team,

I have to switch from one screen  to another when i toggle a toggle button( button toggling is happening from hardware pin) but when i toggle the button, the button is toggling but not going to next screen, can you please help with this?

 

** i'm setting property to toggle the button.

1 Answer

0 votes
by

Hello Shashank,

the button send the OnSwitchOn or OnSwitchOff events only when it is activated manually by the user. I suppose that you either:

Option 1: modify the property Checked of the button in response to the event happening from hardware pin), or ...

Option 2: you have connected the button via its Outline property to some property in the Device Interface, which is modified in response to the hardware pin.

In the first case, when you change Checked property, perform also the screen switch operation.

In the second case, add a Property Observer to your component and connect it via its Outlet property to the property in the Device Interface. The implement the OnEvent slot method of the Property Observer. In the OnEvent slot method you can then react to the notification caused by the alternation of the property in the Device Interface.

I hope it helps you further

Best regards

Paul Banach

by
i think i'm doing option 2, i.e i have property in deviceinterface and making this property as outlet to ToggleButton widget, and i'm assigning userdefined slot to OnSwitchOn , in that slot i'm switching the screen, but it works in simulation mode but when i interface with my hardware pin it is not switching to other screen, am i missing anything?
by
Thanks Paul, it is working now.

Embedded Wizard Website | Privacy Policy | Imprint

...