[Mono-osx] (no subject)

Virginijus mrgutis at gmail.com
Wed Feb 15 14:09:13 UTC 2012


Hey,

  You are closing you "pop-up" window incorrectly. Close method sends close
signal to program. So to close your window you should use code:

*NSApplication.SharedApplication.Stop(this);*

*  this.OrderOut (this);*
I am assuming this code will be put into you "pop-up" window class and
called upon cancel button press.

Regards,
Virgis
On Wed, Feb 15, 2012 at 3:53 PM, David Black <David.Black at casewise.com>wrote:

> ** **
>
> Hi All****
>
> ** **
>
> I’ve been experimenting with monomac for a short while and I’ve come
> across a strange issue. My app has a (so far) empty main Window and a menu
> option that opens a non-modal window for data input. In the cancel button
> action I call the Close method on the window controller for the pop-up
> Window****
>
> ** **
>
> This closes my pop-up and leaves the main window in place (as expected).**
> **
>
> ** **
>
> In my app delegate I added the following****
>
> ** **
>
> public override bool ApplicationShouldTerminateAfterLastWindowClosed
> (NSApplication sender)****
>
> {****
>
>                 return true;****
>
> }****
>
> ** **
>
> Now when I close the pop-up window, even though the main Window is still
> visible, the app quits. This is not what I expected as the main window is
> still there.****
>
> ** **
>
> Is this expected behaviour? Or is it because I have no content in the main
> Window or actions or Outlets and the GC is freeing the window even though
> it’s still visible?****
>
> ** **
>
> Colour me confused J****
>
> ** **
>
> David.****
>
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-osx/attachments/20120215/7f4d7f38/attachment.html>


More information about the Mono-osx mailing list