Skip to main content
zzzzz
Senior
May 14, 2019
Solved

How to create a blocking message box in touchGFX?

  • May 14, 2019
  • 14 replies
  • 3577 views

We have an existing embedded application with older GUI which is being ported to TGFX. For keeping the old logic, we want to display a blocking message box and wait for user response (button click) in a widget callback(GUI button callback). The problem is that the tick is ignored during executing the callback and screen stop rendering. Is there anyway to keep the screen alive during executing widget callback?

Thanks in advance.

This topic has been closed for replies.
Best answer by Martin KJELDSEN

Oh, okay.

It should definitely not be necessary to do this. Is it possible to move this logic to a different task?

/Martin

14 replies

Martin KJELDSEN
Principal III
May 21, 2019

I think you will need to change your logic some. But i don't know the specifics of your application yet - It seems unhealthy for the application to be blocking ticks.

By calling waitForVSync() and backPorchExited() you're essentially "cheating" the TouchGFX event loop. I'd love to hear more about this callback and what kind of code is being executed there.

/Martin

zzzzz
zzzzzAuthor
Senior
May 21, 2019

It is a TGFX button widget callback. In the button callback handler we call one of our function which do all the logic I mentioned earlier. It is not an interrupt.

Like this:

ButtonCallbackHandler

{

    showMessagebox();

    while(no button clicked)

    {

        touchgfx:: OSWrappers::waitForVSync();

        touchgfx::HAL:: getInstance()->backPorchExited();

    }

.....;// handle the response from message box

}

Yes, we are calling these two functions in while loop to fool TGFX. This will unblock the tick during execute CallbackHandler. Is there any potential issue to do this way?

Thanks.

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
May 22, 2019

Oh, okay.

It should definitely not be necessary to do this. Is it possible to move this logic to a different task?

/Martin

zzzzz
zzzzzAuthor
Senior
May 23, 2019

Now we try to move this logic to a different task. thanks.