Great, now I have a general question about NSSavePanel. I'd like to contribute so much, but I'm very far from proficient at AppKit :-(

- (void)beginWithCompletionHandler:(void (^)(NSInteger result))handler

starts a modeless window. My idea would be to save the handler into an instance variable and do this:

NSWindowController *controller = [[NSWindowController alloc] initWithWindow: self];
self->completionHandler = handler;
[controller showWindow: self];
AUTORELEASE(controller);

Then, in -cancel and -ok check whether we were run modally or modelessly (by checking if we have a completion handler) and either call

[NSApp stopModalWithCode: code];

as it is now, or

CALL_BLOCK(completionHandler, code);

Another problem I need some help with is avoiding fragile ABI breakage.

Luboš

On Thu, 20 Jun 2013 16:10:55 +0100, David Chisnall wrote:
Yup, looks good to me,

David





_______________________________________________
Gnustep-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to