• 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: sub classing NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sub classing NSTableView


  • Subject: Re: sub classing NSTableView
  • From: Mike Davis <email@hidden>
  • Date: Sat, 28 Sep 2002 23:49:51 +0100

On Saturday, September 28, 2002, at 10:59 PM, email@hidden wrote:

Date: Sat, 28 Sep 2002 13:38:57 -0600
Subject: Re: sub classing NSTableView
From: Buzz Andersen <email@hidden>
To: email@hidden

now I realize I need to subclass to add in drag and drop capability.

Not necessarily--have you tried using the "tableView: (NSTableView *)
theTableView writeRows: (NSArray*) row toPasteboard: (NSPasteboard*)
pboard" delegate method? It seems to be undocumented for some reason
(somebody correct me if I'm wrong on that), but if you want to get
single-click drags out of your table working, it's definitely the only
reasonable way. I'm passing this on because I just finally learned it
myself after a long, torturous period of experimentation :-).

But how do you handle backspace, copy/cut/paste/delete, which are expected to work on a table view.

I do it by subclassing, which always concerns me that I *must* be doing it a bad way. After all, I just want to use a table, not be one ("has a" vs. "is a") :-) Drag and drop is handled by the delegate for me, though the cut/copy/paste/delete routines are common (in the delegate).

In Only Mortal, I actually made a table class which I shoved in a framework, to hide the evilness. Perhaps we should prod Apple to add this functionality? Delegate methods seem appropriate to me. I added some methods to my sub-class to use the delegate, if it respondsTo() certain category methods, in order to handle the Edit menu.

I like your name, btw. Sounds most cool.


--
Buzz Andersen
email: email@hidden
web: http://www.scifihifi.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: NSImageView scrolling
  • Next by Date: Displaying Current Time using Cocoa
  • Previous by thread: Re: sub classing NSTableView
  • Next by thread: Re: nil messaging? Is it safe?
  • Index(es):
    • Date
    • Thread