NSTableView as first responder

  • I can readily make an NSTableView as the first responder with:
    [[self window] makeFirstresponder:myTableView];

    But how do I make an individual cell in a table view row getting the
    focus (other than doubleclick into the row, of course). Is that
    possible?

    Ivan
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On jeudi, mai 8, 2003, at 03:08  PM, Ivan Myrvold wrote:

    > I can readily make an NSTableView as the first responder with:
    > [[self window] makeFirstresponder:myTableView];
    >
    > But how do I make an individual cell in a table view row getting the
    > focus (other than doubleclick into the row, of course). Is that
    > possible?

    You're looking for something like this? (From the NSTableView
    documentation)

    editColumn:row:withEvent:select:

    - (void)editColumn:(int)columnIndex row:(int)rowIndex
    withEvent:(NSEvent *)theEvent select:(BOOL)flag
    Edits the cell at columnIndex and rowIndex, selecting its entire
    contents if flag is YES. This method is invoked automatically in
    response to user actions; you should rarely need to invoke it directly.
    theEvent is usually the mouse event that triggered editing; it can be
    nil when starting an edit programmatically.

    This method scrolls the receiver so that the cell is visible, sets up
    the field editor, and sends
    selectWithFrame:inView:editor:delegate:start:length: and
    editWithFrame:inView:editor:delegate:event: to the field editor's
    NSCell object with the NSTableView as the text delegate.

    The row at rowIndex must be selected prior to calling
    editColumn:row:withEvent:select:, or an exception will be raised.

    See Also: - editedColumn, - editedRow
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
previous month may 2003 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Go to today