GUI LOCKS for refreshing during some loops

Post

Posted
Rating:
#1 (In Topic #1294)
Regular
sergioabreu is in the usergroup ‘Regular’
If one form acts on another and the second form has a long loop - tried to use wait, it seems that it can not refresh the first form graphics until it ends ?
I refer on changing labels, colors, etc

I tried using wait with a delay and get a warning:

gb.gtk3: warning: calling the event loop during a keyboard event handler is ignored


Anyone know how to solve ?
Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
sergioabreu is in the usergroup ‘Regular’
 Scenario:

Before the task, it has also has a "confirm" messagebox (Yes/no).

The first form gets freezed until the task in the second ends. Is it "normal" ?
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
 Try just Wait on its own, no delay

Or make a Timer that runs the function outside of the key event handler

But any lengthy task that's not a background task will halt your program while it performs.

Using Wait is the way but not good to use it inside the key event so in the key event you would just do this…

HRunFunctionTimer.Start

Then HRunFunctionTimer_Timer() method runs the task using Wait however it wants to
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
sergioabreu is in the usergroup ‘Regular’

BruceSteers said

Try just Wait on its own, no delay

Tried that and WORKED LIKE A CHARM … using wait with no delay  Tks  ;)

Surprising that just omitting an argument changes the behaviour so drastically… I would even think that it could be a "subtil bug" in wait function.
Online now: No Back to the top

Post

Posted
Rating:
#5
Guru
BruceSteers is in the usergroup ‘Guru’

sergioabreu said

BruceSteers said

Try just Wait on its own, no delay

Tried that and WORKED LIKE A CHARM … using wait with no delay  Tks  ;)

Surprising that just omitting an argument changes the behaviour so drastically… I would even think that it could be a "subtil bug" in wait function.

No it's just how Wait is ,
providing a delay makes it behave differently , there's also "Wait Next"


It is explained ion the Wait wiki page /lang/wait - Gambas Documentation

somebody said

If Delay is not specified:

The function processes all pending events and returns immediately, but in that specific case, input events (keyboard and mouse) are ignored."
Online now: No Back to the top
1 guest and 0 members have just viewed this.