• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Minimizing Sheets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Minimizing Sheets


  • Subject: Re: Minimizing Sheets
  • From: Jason Coco <email@hidden>
  • Date: Fri, 17 Oct 2008 09:57:49 -0400


On Oct 17, 2008, at 06:03 , Gerriet M. Denkmann wrote:


I have an app which overrides -[NSWindow miniaturize:] in a category (to avoid crowding the dock).
Works perfectly, but...


If this window being minimized has a sheet attached (attachedSheet is non-nil) this will be lost on deminiaturizing. But the modal loop is still running, waiting for some button to be pressed on the now invisible sheet.
In this case Force Quit is the only way out. Not very nice.


So, what can be done?
1. On miniaturize simulate a click on the "Cancel" button of the sheet. But how?

If you have a reference to the cancel button, you can send the performClick:(id)sender message to it on miniaturize...


2. On deminiaturize reattach this sheet. But again: how?

In this case, when your miniaturization method is invoked, check to see if you are in the modal loop. If you are, abort the
loop, set a state variable (probably some private ivar) and miniaturize. When you de-miniaturize, check the state var and if
set, display the sheet and start the modal loop again...


3. (don't like this very much) refuse to miniaturize if a sheet is open.

HTH, Jason

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Minimizing Sheets
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >Minimizing Sheets (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: Desired Tabbing order not working
  • Next by Date: Re: Hand-building an Application Menu
  • Previous by thread: Minimizing Sheets
  • Next by thread: Re: Minimizing Sheets
  • Index(es):
    • Date
    • Thread