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 cplo...@gmail.com: 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.


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to