[Gambas-user] Message Box Already Displayed

Tobias Boege taboege at ...626...
Fri Aug 9 17:32:03 CEST 2013


On Fri, 09 Aug 2013, bill-lancaster wrote:
> In a fairly simple programme I get this error when only one message box is
> displayed
> 
> Is there a known cause for this?
> 

The cause is that you *want* to display another one... This sometimes
happens to me when I display a Message box from an event handler. It seems,
while the Message box is displayed (waiting for the user), the event loop is
called again and may dispatch the same event another time which will then
cause your error.

I personally use this construct to serialise these Message boxes:

Do
  Try Message.Error(("This was an error"))
While Error

instead of just

Message.Error(("This was an error"))

Regards,
Tobi




More information about the User mailing list