[Gambas-user] Issue 395 in gambas: Wait instruction conflicts with Process Wait

gambas at ...2524... gambas at ...2524...
Sun Jan 27 21:19:36 CET 2013


Status: New
Owner: ----
Labels: Version-3.3.4 Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any  
Desktop-Any GUI-Any

New issue 395 by cplopez at ...626...: Wait instruction conflicts with Process  
Wait
http://code.google.com/p/gambas/issues/detail?id=395

1) When using Wait to allow the program to process events, they may be  
processed out of time when waiting the result of a process called with  
Shell.

2)

[System]
OperatingSystem=Linux
Kernel=2.6.35-32-generic
Architecture=i686
Memory=2051224 kB
DistributionVendor=Ubuntu
DistributionRelease="Ubuntu 10.10"
Desktop=Gnome

[Gambas 2]
Version=2.21.0
Path=/usr/bin/gbx2

[Gambas 3]
Version=3.3.4
Path=/usr/bin/gbx3

[Libraries]
Qt4=libQtCore.so.4.7.0
GTK+=libgtk-x11-2.0.so.0.2200.0


3)

Create a Form with a TextBox named TextBox1, and put the following code on  
the form:

--------------------------

Public Sub Form_KeyPress()
   Me.Text = "1"
   Wait 0.5
   Shell "sleep 2" Wait
   Me.Text = "2"
End

Public Sub TextBox1_KeyPress()
   Debug Key.Normal
End

--------------------------

5) Explain clearly how to reproduce the bug or the crash.

Run the project and press a key; hold it for a little more than just a key  
press. After the process (sleep in this case) ends, the KeyPress event will  
raise from TextBox1, but, since no key is being pressed, the error "No  
keyboard event data" will be raised.

I was trying a code like this to start a process with a key press, show a  
wait message, and then hide the message after the process end. Some other  
controls grab also KeyPress, and the event is received by them after the  
process.





More information about the User mailing list