Re: How do people typically implement dialog controllers?
Re: How do people typically implement dialog controllers?
- Subject: Re: How do people typically implement dialog controllers?
- From: Seth Willits <email@hidden>
- Date: Wed, 10 Sep 2008 20:52:26 -0700
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@hidden)
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:
This email sent to email@hidden