[Gambas-user] [Gambas Bug Tracker] Bug #960: Cannot get dynamically created SerialPort control events to raise.

bugtracker at ...3416... bugtracker at ...3416...
Fri Jul 1 15:53:31 CEST 2016


http://gambaswiki.org/bugtracker/edit?object=BUG.960&from=L21haW4-

Comment #5 by zxMarce:

Tobias,

Not precisely the case, but yup, the bug's invalid.

I originally used SLEEP out of the event handler, thus -unknowingly to me- giving Gambas no chance to actually trigger the event. Never used WAIT, not in the handler nor in the external loop.
When I -hinted by Alex- changed SLEEP to WAIT outside the event code to yield to the message loop, boom! The event triggered as originally expected.

I would not call this an issue if I were as experimented as some folks like you are here, but for thick-skulls like myself Gambas can be a little puzzling at times.
Using WAIT never crossed my head, and I did not read the SLEEP page. It is right there: "The event loop is not called during a sleep, and so events are not processed.", duh!

I think the wiki pages for EventLoop, WAIT and SLEEP should all be related/connected to avoid these pitfalls.
Pages for EventLoop and WAIT point to each other in See Also, but they do not mention SLEEP.
Also there's no warning about freezing events due to SLEEP in either EventLoop or WAIT pages.

Thanks again!






More information about the User mailing list