• 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: When the sender is an NSMatrix...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When the sender is an NSMatrix...


  • Subject: Re: When the sender is an NSMatrix...
  • From: David Vernon <email@hidden>
  • Date: Tue, 8 Jul 2003 10:24:46 +1000

I've had the same problem, I can't get the cell to be the sender. Try
something like this (all of this is of course reproducable in Obj. C):

public void ToolPaletteAction (Object sender) {
NSMatrix tmp = (NSMatrix)sender;

NSPoint locationClicked = NSEvent.mouseLocation();
locationClicked =
(window().convertScreenToBase(locationClicked));
SetTool (tmp.cellAtLocation(tmp.rowForPoint(locationClicked),
tmp.columnForPoint(locationClicked)).tag());
}

Cells are detected correctly using this method, but tags are sort of
reordered because of the origin location in the matrix's window. I'm
sure you could remedy this but it hasn't bugged me enough to do this
yet.


On Monday, July 7, 2003, at 08:09 PM, John Lombardo wrote:

> I'm trying to get a method to distinguish between several
> NSButtonCells in
> an NSMatrix. The problem I'm having is that [sender tag] is giving the
> tag
> value of the Matrix rather than of the button that was clicked. I've
> tried
> wiring the action to both the Matrix and the ButtonCell (though not at
> the
> same time) however the result is still the same. Is there a better
> (read:
> working) means of determining which button was pressed?
>
> Cheers,
> John Lombardo
> _______________________________________________
> 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.
>
>
-----------------------
David Vernon

Computer Systems Officer
School of Information Technology and Computer Science
University of Wollongong
Northfields Avenue,
Wollongong, NSW
Australia

Phone: +61 2 42215669
_______________________________________________
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.

  • Follow-Ups:
    • Re: When the sender is an NSMatrix...
      • From: j o a r <email@hidden>
    • Re: When the sender is an NSMatrix...
      • From: Sailor Quasar <email@hidden>
References: 
 >When the sender is an NSMatrix... (From: John Lombardo <email@hidden>)

  • Prev by Date: Re: non-blocking file writes
  • Next by Date: Re: When the sender is an NSMatrix...
  • Previous by thread: Re: When the sender is an NSMatrix...
  • Next by thread: Re: When the sender is an NSMatrix...
  • Index(es):
    • Date
    • Thread