• 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: Bindings and MenuItems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings and MenuItems


  • Subject: Re: Bindings and MenuItems
  • From: Ben Lachman <email@hidden>
  • Date: Fri, 03 Apr 2009 17:52:28 -0400

On Apr 3, 2009, at 6:14 AM, Alexander Spohr wrote:

Am 03.04.2009 um 06:49 schrieb Ben Lachman:

No. That was what my original message outlined. Say you have a table view selected and hit cmd-p. NSView has a default implementation of print: so it will print the table view. In my case and in many others what you really want to print is the detail view or some representation of it that actually shows the currently data of the selected object(s). So no that's not really what the first responder is for.

Why not subclassing that table view and overriding print:?

This breaks the MVC paradigm. You'd have to forward print: to another view or better, forward it up to the controller and let the controller figure out what to do with it, although I think this kind of breaks the validateMenuItem interface. But you still have the problem that many different views can be first responder. You'd basically have to subclass every view that accepts first responder and override print: in each. It would also make code reuse much more cumbersome. All the views for one printing state would have to have a separate subclass from the views for the other printing state (this was my original issue, how do you manage printing when you have two main detail views that you swap between?).


->Ben
--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

email: email@hidden
twitter: @benlachman
mobile: 740.590.0009

_______________________________________________

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


References: 
 >Bindings and MenuItems (From: Ben Lachman <email@hidden>)
 >Re: Bindings and MenuItems (From: Andy Lee <email@hidden>)
 >Re: Bindings and MenuItems (From: Ben Lachman <email@hidden>)
 >Re: Bindings and MenuItems (From: Keary Suska <email@hidden>)
 >Re: Bindings and MenuItems (From: Ben Lachman <email@hidden>)
 >Re: Bindings and MenuItems (From: Alexander Spohr <email@hidden>)
 >Re: Bindings and MenuItems (From: Ben Lachman <email@hidden>)
 >Re: Bindings and MenuItems (From: Alexander Spohr <email@hidden>)

  • Prev by Date: Re: Best Practice for reading a string with NSScanner
  • Next by Date: Re: user access privileges to plist in /library/preferences
  • Previous by thread: Re: Bindings and MenuItems
  • Next by thread: Re: Shortcut handling in different keyboard layouts
  • Index(es):
    • Date
    • Thread