Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting First Responder to Table Cells



You can do it with this call method:

	editColumn:row:withEvent:select:

The method takes 4 parameters:
1. the column index -- NB this is zero-based, so first column is 0, second column is 1 etc
2. the row index - NB this is zero-based, so first row is 0, second row is 1 etc
3. an NSEvent -- should be nil I think, but for this purpose it seems it will accept pretty much anything, so in the example below, which I have tested, I have pased 0
4. a boolean -- 1 for true


You can find the documentation for the method in the XCode documentation under the NSTableView class or here on the web: <http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTableView_Class/Reference/Reference.html#//apple_ref/occ/instm/NSTableView/editColumn:row:withEvent:select: >

Here is an example that ... makes a table view the first responder of a window, selects the fifth row in the table view, selects the content of the editable cell in the fourth column of that row:

set theWindow to window 1
set theTable to table view 1 of scroll view 1 of theWindow
--
set first responder of theWindow to theTable
set selected row of theTable to 5
call method "editColumn:row:withEvent:select:" of object theTable with parameters {3, 4, 0, 1}


Philip


On 26 May 2008, at 05:36, Konrad Lawson wrote:

BareFeet asked an interesting question about memory handling of tables
that I would also be curious to see what others think about.

While we are on the topic of tables however, I have a question of my
own.

How does one go about setting the first responder to (or, if that is the
wrong way to ask this question: "how does one set the active cursor in")
a table cell that is editable?


Available samples, macscripter postings, and documentation show how this
can be done for regular text
fields, but what about table cells?


Best,

K. M. Lawson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
References: 
 >Setting First Responder to Table Cells (From: "Konrad Lawson" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.