• 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
Trouble with draggable cells in NSMatrixView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trouble with draggable cells in NSMatrixView


  • Subject: Trouble with draggable cells in NSMatrixView
  • From: Colin Cornaby <email@hidden>
  • Date: Sat, 2 Dec 2006 19:01:15 -0800

I'm trying to implement an NSMatrix that contains draggable cells. I have an NSMatrixView subclass, and have successfully populated it. I quickly ran into a problem though. As far as I can tell, in order for my subclass to recieve mouseDragged events in order to actually start the dragging operation for the user, I have to catch any mouseDown events. I'm guessing this tells Cocoa to use my subclass for handling any drag events that occur afterwards.

The problem is if I am catching any mouseDown calls in my NSMatrixView subclass, the mouseDown calls are never received by the super class, and the user can't select a different cell within the matrix.

I have tried several things. One thing I have tried is simply forwarding on the mouseDown event on to the super class, but this of course breaks my dragging code because my sub class is no longer the last class to handle the mouseDown event. The second thing I tried, which seems like it should be the solution to my problem, is setting the mode of my matrix to NSTrackModeMatrix after it is populated, but this doesn't seem to be working at all. The selection is not changed and does not seem to actually be tracking the mouse. I'm wondering if this has something to do with the NSMatrixView being contained within an NSScrollView.

Does anyone have any pointers? I've been running this code past a few other Cocoa people, and by all accounts the track mode solution should work, but it simply doesn't.

Thanks,
Colin
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Prev by Date: Re: DiskArbitration & Finder
  • Next by Date: Re: NSWindowController subclass initialization
  • Previous by thread: Re: AppleScript opens a doc, handleOpenScriptCommand: raises exception
  • Next by thread: Creating an NSTypeSetter Subclass
  • Index(es):
    • Date
    • Thread