On Sep 10, 2008, at 7:48 PM, Graham Cox wrote:

OK, this is bit of a nebulous question, but I'm curious to know how people are typically implementing controllers for dialog panels.

I follow the NSOpenPanel pattern where the panel is its own controller.


SWSomethingPanel * panel = [SWSomethingPanel myPanel];
[panel setThis:123];
[panel setThat:abc];
[panel beginSheetModalForWindow:windo]
modalDelegate:self didEndSelector:@selector(myPanelDidEnd:returnCode:contextInfo:) contextInfo:info];

....

- (void)myPanelDidEnd:(SWSomethingPanel *)panel returnCode: (NSInteger)returnCode contextInfo:(void *)contextInfo;
{
        ...
        123 = [panel this];
        abc = [panel that];
        ...
}


The panel can handle its settings however it wishes (completely irrelevant to the caller, of course). Mine are all simple enough that bindings don't offer anything extra, so I so far have stuck to just plain old school code. I could save two or three lines if I used bindings in a few places, but eh... who's counting?


--
Seth Willits




_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to