Re: Binding InfoPanel to currentDocument

2012-10-26 Thread Gerriet M. Denkmann
. I thought that having some InfoPanel which shows data of the current NSDocument would be a fairly common scenario. But anyway. I decided to follow your suggestions. My app delegate now has: @property (strong) GmdDocument *currentDocument; In applicationDidFinishLaunching: it registers

Re: Binding InfoPanel to currentDocument

2012-10-26 Thread Kyle Sluder
(strong) GmdDocument *currentDocument; In applicationDidFinishLaunching: it registers for NSWindowDidBecomeMainNotification and NSWindowWillCloseNotification (not for NSWindowDidResignMainNotification because I want my InfoPanel to keep it's data when some other app becomes active

Re: Binding InfoPanel to currentDocument

2012-10-26 Thread Gerriet M. Denkmann
to follow your suggestions. My app delegate now has: @property (strong) GmdDocument *currentDocument; In applicationDidFinishLaunching: it registers for NSWindowDidBecomeMainNotification and NSWindowWillCloseNotification (not for NSWindowDidResignMainNotification because I want my

Re: Binding InfoPanel to currentDocument

2012-10-26 Thread Mike Abdullah
of the current NSDocument would be a fairly common scenario. But anyway. I decided to follow your suggestions. My app delegate now has: @property (strong) GmdDocument *currentDocument; In applicationDidFinishLaunching: it registers for NSWindowDidBecomeMainNotification

Re: Binding InfoPanel to currentDocument

2012-10-26 Thread Kyle Sluder
On Oct 26, 2012, at 6:52 AM, Mike Abdullah cocoa...@mikeabdullah.net wrote: Yes. I saw that in your previous post. But I asked both AppKiDo and Xcode and nobody showed me any documentation about this accessor. So I am wary of using undocumented stuff. It's actually a method on

Binding InfoPanel to currentDocument

2012-10-25 Thread Gerriet M. Denkmann
I have a Panel which has a PopUpButton which has it's Content Values bound to an ArrayController. The ArrayController has it's Content Array bound to File's Owner: currentDocument.listOfThings. The File's Owner (aka) Application Delegate: @property (readonly) DocumentSubclass *currentDocument

Re: Binding InfoPanel to currentDocument

2012-10-25 Thread Seth Willits
On Oct 25, 2012, at 4:36 AM, Gerriet M. Denkmann wrote: This works, but I have a strong feeling that there is a very obvious better solution which I somehow cannot see. There actually isn't an obvious solution. -[NSDocumentController currentDocument] isn't KVOable (which is a bummer

Re: Binding InfoPanel to currentDocument

2012-10-25 Thread Kyle Sluder
On Thu, Oct 25, 2012, at 09:42 AM, Seth Willits wrote: But, if you just use the -object in the notification to windowDidBecomeMain: you're fine. So if you keep a reference to that window/document yourself and return it from your own currentDocument that'd work. You also need to watch

Re: Binding InfoPanel to currentDocument

2012-10-25 Thread Seth Willits
currentDocument that'd work. You also need to watch windowWillResignMain: windowWillClose: and optionally(?) applicationDidBecomeActive: (And actually, this is how Omni has been doing it for yars.) NSWindow has a -document accessor, so you don't need to override -currentDocument. But yes

currentDocument

2008-12-02 Thread gMail.com
Hi, I use to get the currentDocument this way [[NSDocumentController sharedDocumentController] currentDocument] It works well but not in the following case My apps opens automatically a document with - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError

Re: currentDocument

2008-12-02 Thread Jerry Krinock
On 2008 Dec, 02, at 8:06, gMail.com wrote: I really build my objects using the dictionary mDocDict. But at this point [[NSDocumentController sharedDocumentController] currentDocument] returns nil.. How to fix this? Looks like your document is not registered

Re: currentDocument

2008-12-02 Thread Michael Ash
On Tue, Dec 2, 2008 at 11:06 AM, gMail.com [EMAIL PROTECTED] wrote: Hi, I use to get the currentDocument this way [[NSDocumentController sharedDocumentController] currentDocument] It works well but not in the following case My apps opens automatically a document with - (BOOL