• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSDocumentController, NSDocument and toolbars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocumentController, NSDocument and toolbars


  • Subject: Re: NSDocumentController, NSDocument and toolbars
  • From: "John Love" <email@hidden>
  • Date: Sun, 27 Jul 2008 15:05:03 -0400

>
> Well, what do you want the tool bar item to actually *do*? Whatever it is,
> and whatever object is responsible for handling it is your action and
> target, respectively. Just like a menu item.
>

I want it to call NSDocumentController's openDocument: which is the action
of the "Open ..." File menu item.  I use my override of NSDocument's
readFromURL: to do my unique stuff after NSApp's runModal dialog is
dismissed.


>
>  openDocument: is a method of NSDocumentController, not NSDocument ...
>> *unless* I place this action method within my MedDocument ... and such a
>> place is clearly wrong
>>
>
> So maybe set the target to the document controller, not self?
>

 Absolutely .  So in my sub-class of NSDocument,  I call my own customized
Toolbar routine(s) within my override of -windowControllerDidLoadNib.  Just
how do I pass an instance of NSDocumentController to these Toolbar
routine(s)?  Only the NSWindowController is passed to
the windowControllerDidLoadNib method, not the NSDocumentController?  If I
can somehow get an instance of NSDocumentController, then I could
call: [MyNSDocumentController
URLsFromRunningOpenPanel]; which apparently is the 1st thing done within
openDocument:

Which begs the question .. do I also wish to create a sub-class of
NSDocumentController within my mainNib file also and do the Toolbar stuff
within there .. don't see how right now, but I have done very little
thinking about this possibility.


If I seem like I'm grasping at a windmill, that is very accurate.


John
_______________________________________________

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

  • Follow-Ups:
    • Re: NSDocumentController, NSDocument and toolbars
      • From: Graham Cox <email@hidden>
References: 
 >NSDocumentController, NSDocument and toolbars (From: "John Love" <email@hidden>)
 >Re: NSDocumentController, NSDocument and toolbars (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: NSGraphicsContext restore crashes my xtension
  • Next by Date: Re: IB view transitions, CA, NSWindow animation
  • Previous by thread: Re: NSDocumentController, NSDocument and toolbars
  • Next by thread: Re: NSDocumentController, NSDocument and toolbars
  • Index(es):
    • Date
    • Thread