Re: -clickedRow

2015-11-06 Thread Raglan T. Tiger
> On Nov 5, 2015, at 1:51 PM, Jens Alfke wrote: > > Convert the position to local coords, then call -rowAtPoint:. I woke up last night and thought exactly that which I have used before ... must be dementia on the rise ! -rags

Re: -clickedRow

2015-11-06 Thread corbin dunn
> On Nov 5, 2015, at 12:51 PM, Jens Alfke <j...@mooseyard.com> wrote: > > >> On Nov 5, 2015, at 12:35 PM, Raglan T. Tiger <r...@crusaderrabbit.net> wrote: >> >> In -rightMouseDown I call [self clickedRow] which always returns -1 in a row >> or

Re: -clickedRow

2015-11-06 Thread Charles Srstka
> On Nov 5, 2015, at 2:35 PM, Raglan T. Tiger <r...@crusaderrabbit.net> wrote: > > I subclass NSTableView to catch -rightMouseDown > > In -rightMouseDown I call [self clickedRow] which always returns -1 in a row > or not in row > > What should I b

Re: -clickedRow

2015-11-05 Thread Jens Alfke
> On Nov 5, 2015, at 12:35 PM, Raglan T. Tiger <r...@crusaderrabbit.net> wrote: > > In -rightMouseDown I call [self clickedRow] which always returns -1 in a row > or not in row Yeah, you’re getting control before the base class has had a chance to set the clickedRow propert

-clickedRow

2015-11-05 Thread Raglan T. Tiger
I subclass NSTableView to catch -rightMouseDown In -rightMouseDown I call [self clickedRow] which always returns -1 in a row or not in row What should I be doing to get the clicked row? -rags ___ Cocoa-dev mailing list (Cocoa-dev

NSTableView binding and clickedRow returning -1

2015-01-05 Thread Hajder Rabiee
Hi Thought I would post something I see as reoccurring problem. Basically, having an NSTableView (wrapped in a custom NSView) setup with bindings works fine. Then, trying to get the double-action/target in IB working has strange behaviour when it comes to fetching clickedRow. *Referring to my

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-09 Thread Markus Spoettl
On 8/9/12 12:58 AM, Graham Cox wrote: NSCell apparently uses NSCopyObject() to make a copy of itself, and NSTableView copies cells at times, e.g. for hit testing. If you have a custom cell subclass that supports copying, DO NOT use [super copyWithZone:] followed by your custom copy stuff. Since

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-09 Thread Markus Spoettl
On 8/9/12 8:14 AM, Markus Spoettl wrote: On 8/9/12 12:58 AM, Graham Cox wrote: NSCell apparently uses NSCopyObject() to make a copy of itself, and NSTableView copies cells at times, e.g. for hit testing. If you have a custom cell subclass that supports copying, DO NOT use [super copyWithZone:]

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-09 Thread Graham Cox
On 09/08/2012, at 4:14 PM, Markus Spoettl ms_li...@shiftoption.com wrote: Not calling super sounds like a bad idea. Yep, I realise that now. So call super, but you need to know whether it's going to call through your -init method or not (for cells, it does not). --Graham

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-09 Thread Quincey Morris
On Aug 9, 2012, at 00:04 , Graham Cox graham@bigpond.com wrote: So call super, but you need to know whether it's going to call through your -init method or not (for cells, it does not). Except that you do sort-of know (I think). If it does, all your instance variables are 0. If you have

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-09 Thread Graham Cox
On 09/08/2012, at 5:31 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: So call super, but you need to know whether it's going to call through your -init method or not (for cells, it does not). Except that you do sort-of know (I think). If it does, all your instance

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-09 Thread Kyle Sluder
-menuForEvent: and don't call super, you don't get the right values for -clickedRow: and -clickedColumn:, and you don't get the right-click menu highlighting. As I mentioned, I already filed the first; the second is now filed as rdar://problem/12067701 (NSTableView won't show right-click highlight

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-08 Thread Keary Suska
. Please see the DragNDropOutlineView demo application for an example of how to properly do contextual menus with a TableView. The key thing to note is that clickedRow and clickedColumn will now both be valid when a contextual menu is popped up. In addition, one can dynamically set

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-08 Thread Corbin Dunn
better contextual menu support. Please see the DragNDropOutlineView demo application for an example of how to properly do contextual menus with a TableView. The key thing to note is that clickedRow and clickedColumn will now both be valid when a contextual menu is popped up. In addition, one

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-08 Thread Kyle Sluder
decision, since it essentially forces you to use a menu delegate to build your menu rather than just handing back the correct NSMenu instance from -menuForEvent:. Is there a reason that I shouldn't file a bug asking for clickedRow to be set as soon as the row is clicked? --Kyle Sluder

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-08 Thread Corbin Dunn
to do this. I've always thought this was an extremely odd design decision, since it essentially forces you to use a menu delegate to build your menu rather than just handing back the correct NSMenu instance from -menuForEvent:. Is there a reason that I shouldn't file a bug asking for clickedRow

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-08 Thread Kyle Sluder
On Wed, Aug 8, 2012, at 01:21 PM, Corbin Dunn wrote: On Aug 8, 2012, at 11:38 AM, Kyle Sluder k...@ksluder.com wrote: Is there a reason that I shouldn't file a bug asking for clickedRow to be set as soon as the row is clicked? I just hadn't thought that people would have needed

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-08 Thread Corbin Dunn
On Aug 8, 2012, at 2:05 PM, Kyle Sluder k...@ksluder.com wrote: On Wed, Aug 8, 2012, at 01:21 PM, Corbin Dunn wrote: On Aug 8, 2012, at 11:38 AM, Kyle Sluder k...@ksluder.com wrote: Is there a reason that I shouldn't file a bug asking for clickedRow to be set as soon as the row is clicked

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-08 Thread Graham Cox
On 09/08/2012, at 3:38 AM, Corbin Dunn corb...@apple.com wrote: No it hasn't changed, but the clicked row is set *after* you return a menu. That way your menu validation code can use it. I think the DragNDropOutlineView demo shows how to do this. OKaaay I can figure it from the cell

Re: NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-08 Thread Kyle Sluder
On Wed, Aug 8, 2012, at 02:48 PM, Corbin Dunn wrote: Cool; note that with View Based TableViews these types of things are easier to do, since one can just do normal view stuff, and easily query for what row they are in (via rowForView:) It does make it easier for subviews that want to perform

NSTableView not setting -clickedRow, -clickedColumn as it should

2012-08-07 Thread Graham Cox
application for an example of how to properly do contextual menus with a TableView. The key thing to note is that clickedRow and clickedColumn will now both be valid when a contextual menu is popped up. In addition, one can dynamically set the popup menu for a particular cell/column

NSTableView double click binding and clickedRow

2008-03-18 Thread Paul Thomas
/action message using setTarget: and setDoubleAction:, everything works fine and I can get clickedRow to tell me the row. If I use bindings in IB3 and bind Double Click Target, I get the action message, but clickedRow is always -1. So, is this a bug? If so, I'll radar it. But I wanted