According to Apple's Sheet Programming Topics, to create a custom sheet for use with some kind of modal operation, one just needs to invoke NSApp's beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:
method. However, it looks as though this method has been deprecated in OS X 10.9 in favor of the other block-based methods. I'm fine with using blocks, but there doesn't seem to be any other way to customize the style/design of the sheet. The problem is, my UI is dark, and I really want to have a unified interface. Am I missing something, or am I going to have to roll my own? Any hints, tips, or tricks welcome!
Asked
Active
Viewed 1,198 times
3

Ben Stock
- 1,986
- 1
- 22
- 30
-
2Why doesn't beginSheet:completionHandler: work for you? The beginSheet: argument is an NSWindow which you can customize however you want. – rdelmar Dec 01 '13 at 01:08
-
@rdelmar: Nice! I couldn't find the `beginSheet:completionHandler:` in `NSApp`, so I searched for it in `NSWindow`. I'm assuming that's what you're talking about because it works great. Thanks a lot! One thing to note: I had to check "Non Activating" in Interface Builder, or the sheet would be floating somewhere in the middle of the screen. – Ben Stock Dec 01 '13 at 13:02
-
@rdelmar that should be an answer, even if you don't need the rep ;) – Guillaume Algis Dec 01 '13 at 16:52
-
@GuillaumeAlgis: Is there a way to change the comment rdelmar made into an answer? I up-voted his comment, but I'd like to give credit where credit is due. – Ben Stock Dec 03 '13 at 03:42
-
I don't think so. Maybe a moderator can do it. Dunno. – Guillaume Algis Dec 03 '13 at 10:43
-
2@GuillaumeAlgis: Oh, well … We tried. rdelmar's just too cool for school. If anyone's wondering, though, rdelmar's comment led me in the right direction. The `beginSheet:completionHandler:` is an instance method of `NSWindow`. I guess Apple moved most (all?) sheet delegation from `NSApp` to `NSWindow`. You won't find this information anywhere in the documentation either (the "Sheets Programming Topics" was last updated in May 2009), except for the crossed out "deprecated" notice in the `NSApp` class reference. – Ben Stock Dec 03 '13 at 17:06
-
It's in the 10.9 AppKit Release Notes. – uchuugaka Feb 25 '14 at 01:33