[Lazarus] Bug 15390 and Showmodal

zeljko zeljko at holobit.net
Tue Apr 17 20:19:13 CEST 2012


On Tuesday 17 of April 2012 17:41:54 patspiper wrote:
> This is related to bug #15390:
> 
> My understanding is that Showmodal blocks until the form is closed.
> Hiding the form should have no effect.
> 
>    try
>      Self.Hide;
>      Form2.ShowModal; //<- this should block until Form2 is closed

So, with your explanation: when you hide modal form it should stay in modal 
loop and application is completelly unresponsive ?

>    finally
>      Self.Show; // <- this should not be reached until Form2 is closed

no, it will be reached as soon as form leaves *modal loop* for any reason 
(closing, hiding).

>      Form2.Free;
>    end;
> 
> What is happening is that Showmodal is exiting when the modal form is
> hidden.

No, FormClose() isn't called when modal form is hidden via Hide(); , so form 
still exists and it can be called with ShowModal() or Show() again.


zeljko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120417/09cf7013/attachment-0003.html>


More information about the Lazarus mailing list