[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnustep-gui and blocks support
From: |
Luboš Doležel |
Subject: |
Re: gnustep-gui and blocks support |
Date: |
Thu, 20 Jun 2013 17:24:36 +0200 |
User-agent: |
Roundcube Webmail/0.5 |
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