|
From: Neil S. <ne...@ha...> - 2005-12-09 12:21:48
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Steven D.Arnold wrote:
> I want
> the _next_ row to become editable, allowing the user to then type in a
> new value that wasn't previously in the list.
I do something like this:
def addClicked
# @data is the array used in my table view data source methods
@data << 'URL'
# @view is the view, now that we added a row, we notify it
# that we did
@view.noteNumberOfRowsChanged
# NOW I select the last row, and begin editing it,
# because I know it is the new row.
row = @urls.size - 1
indexSet = OSX::NSIndexSet.indexSetWithIndex(row)
@view.selectRowIndexes_byExtendingSelection(indexSet, false)
@view.editColumn_row_withEvent_select(0, row, nil, true)
end
- --
Neil Stevens - ne...@ha...
'A republic, if you can keep it.' -- Benjamin Franklin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFDmXbVf7mnligQOmERAmL9AKCad6R40RiO0rfEBRXeD45i3qLcygCbBhrk
mIGs+8H6d1ARswvmO1Qho24=
=uwoj
-----END PGP SIGNATURE-----
|