• 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: 10.11 Issues?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 10.11 Issues?


  • Subject: Re: 10.11 Issues?
  • From: Doug Adams <email@hidden>
  • Date: Sun, 14 Jun 2015 16:35:02 -0400


> I'd been using NSApp's beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: and endSheet:, which were deprecated as of 10.9. I know Shane's Myriad Helpers uses these, too. In 10.11, considering the NSApp problem, I've switched to NSWindow's beginSheet:completionHandler and endSheet:. So far, OK.

This is working for me from 10.8 thru 10.11 (the NSWindow sheet stuff is 10.9 or later only):

	on showSheetOverWindow(aSheet, aWindow)
		if (current application's NSWindow's instancesRespondToSelector:"endSheet:") as boolean is true then
			tell aWindow to beginSheet:aSheet completionHandler:(missing value)
		else
			tell current application's class "NSApplication"'s sharedApplication()
				beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo_(aSheet, aWindow, missing value, missing value, missing value)
			end tell
		end if
	end showSheetOverWindow

	on closeSheetOverWindow(aSheet, aWindow)
		if (current application's NSWindow's instancesRespondToSelector:"endSheet:") as boolean is true then
			tell aWindow to endSheet:aSheet
		else
			tell current application's class "NSApplication"'s sharedApplication()
				endSheet_(aSheet)
			end tell
		end if
	end closeSheetOverWindow


Think there are any issues? If necessary, I use an orderOut on the sheet after calling closeSheetOverWindow(aSheet, aWindow).

(Apologies if it renders badly. I've got to brush up on my code-posting.)

Doug
--
dougscripts.com



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: 10.11 Issues?
      • From: Shane Stanley <email@hidden>
References: 
 >10.11 Issues? (From: Doug Adams <email@hidden>)
 >Re: 10.11 Issues? (From: Shane Stanley <email@hidden>)
 >Re: 10.11 Issues? (From: Doug Adams <email@hidden>)

  • Prev by Date: Re: 10.11 Issues?
  • Next by Date: Re: 10.11 Issues
  • Previous by thread: Re: 10.11 Issues?
  • Next by thread: Re: 10.11 Issues?
  • Index(es):
    • Date
    • Thread