cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a blocking message box in touchGFX?

zzzzz
Senior

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.

14 REPLIES 14
Martin KJELDSEN
Chief III

Hi @zzzzz​,

What kind of "callback" are we talking about here? I just assumed it was a TouchGFX callback but now i'm thinking it's more of an interrupt?

/Martin

Martin KJELDSEN
Chief III

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
Senior

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
Chief III

Oh, okay.

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

/Martin

zzzzz
Senior

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