[Gambas-user] How to pause/defer an event handler if a popup is open?

BB adamnt42 at gmail.com
Wed Dec 20 09:38:12 CET 2023


On 20/12/23 5:28 pm, BB wrote:
> The form in my FMain has an event handler that responds to DBus events 
> that are raised in another process. There is also a button handler in 
> my FMain that needs user input and an "OK" button that updates 
> database data. That button handler needs to take precedence over the 
> DBUS event, but I don't want to lose the updates that are caused by 
> the other process. So how can I make the button event handler "block" 
> the DBus event handler until it has finished?
>
> merry festive seasons and tia
>
> bruce
>
Okay, I turned this upside down and check for whether the FMain button 
form is active in the DBus event handler. In the button event handler I 
set a global flag "UserActive=True" before the popup opens and reset it 
after the popup is closed. In the DBus event handler I check if 
UserActive is true then wait 10 seconds. It seems to work but I'm not 
really happy, is there a better way?

b



More information about the User mailing list