binding to currentDocument
binding to currentDocument
- Subject: binding to currentDocument
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Fri, 11 Aug 2006 18:44:01 +0200
In a document based app I have an Info Panel with an NSTextField
which is bound to "'someString"
MyDocument.m: (MyDocument is the delegate of its window)
- (void)windowDidBecomeMain:(NSNotification *)aNotification
{
[ [ [ NSApp delegate ] valueForKey: @"inspectorController" ]
setContent: self ];
}
- (void)close
{
[ [ [ NSApp delegate ] valueForKey: @"inspectorController" ]
setContent: nil ];
[ super close ];
}
[ NSApp delegate ].h:
IBOutlet NSObjectController *inspectorController;
IBOutlet NSPanel *infoPanel ;
[ NSApp delegate ].m:
- (IBAction)showInfoPanel: (id)sender ;
{
if ( infoPanel == nil ) load nib ...
[ inspectorController setContent: [ [ NSDocumentController
sharedDocumentController ] currentDocument ] ];
[ infoPanel makeKeyAndOrderFront: self ];
}
This looks like quite a lot of glue code. Is there some easier way to
accomplish this?
Gerriet.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden