714 views
in GUI Development by
Hi,

I am writing my logic code in a separate thread, then the thread calls some UI callback functions to display some prompt messages and also respond keypad and touch action. Some thing like this,

1. Do something

2. Pop up a prompt message to indicate the result and next instruction

3. Wait for key pressed or touch action

4. If Key pressed, hide or destroy the prompt and back to main screen

Note: in main screen, touch and key are also supported, but the action response is absolutely different from that with prompt.

 

UI callbacks for key, touch and message show/hide

   void TestSetKey(uint32_t key);

   void TestSetTouch(void);

   void ShowTestUIMsg(Test_UI_Message *pMsg, uint32 count, uint32 bk_color);

   void HideTestUIMsg(void);

 

What I am trying is create a prompt class to add some text box and draw the background, and add simple touch handler, key press handler. This prompt class will be createdin class application, that is the main screen. By default, BeginModal() will not be called for not respond key and touch , and the prompt is invisable. So the question is how do I implement ShowTestUIMsg() and HideTestUIMsg() to let GUI to show or hide the prompt and respond key or touch?

Leo

1 Answer

0 votes
by

Hi Leo,

The Embedded Wizard code is single threaded, this means when you want the GUI to show/hide anything you have to synchronize your request with the GUI thread.
For this I would recommend to send a message to the GUI to perform this job and listen for messages which you send from the GUI thread to get any results.

When you receive your message within the GUI thread, you have multiples ways to pass this message data to the GUI.
As one example, please see https://ask.embedded-wizard.de/300/how-to-exchange-strings-between-gui-and-a-device?show=300#q300

Note: Hiding the popup can be done within the GUI itself.

I hope this helps,
Rudolf

Embedded Wizard Website | Privacy Policy | Imprint

...