259 views
in GUI Development by

I want to shutdown an Embedded Wizard UI application programmatically (e.g. by pressing on a button). Does a method exist here that I can use in my slot method which is invoked when pressing the button?

I saw inside the the EmWiMainLoop the following code:

/* Endless loop, until the 'power' key is pressed... */
  while ( cmd != CoreKeyCodePower )

So I tried to programmatically send a Power Key-Event, but that didn't have any effect. Is this the right approach or is there an easier way to shutdown a GUI  application?

1 Answer

0 votes
by

Hi,

you will need to break the main loop and perform the following steps to shutdown the application as described in De-Initialization of the Embedded Wizard GUI Application. The simplest would be to evaluate in the condition of the main loop a C variable, you can set when the user presses a button. Like a flag.

Hope it helps you.

Best regards

Paul Banach

by
Hi Paul,

thanks for your advice! I could implement your proposed solution easily, it now works like a charm!

Maybe you can spent a thought on providing a higher level shutdown function for shutting down the application in a future version of Embedded Wizard. I would welcome this function, but I'm biased here ;-)

Thanks again for helping me out!

Andreas

Embedded Wizard Website | Privacy Policy | Imprint

...