On Monday, February 3, 2003, at 04:10 AM, Rich Morin wrote:
Note that a mouse click does two things: it selects a row, and gives the input focus - i.e. First Responder status - to the table view.This works, to the extent that the last row acquires a gray band (as shown in sel_ng.pdf). However, it does not produce the golden band and consequent explanatory text (as in sel_ok.pdf) that I get when I click another row, then click back on the last row.What am I missing?
It shouldn't be. It's not part of your data source, it's part of your controller logic. So, it belongs in your controller class. Even in a trivial demo app in which a single class serves as both controller and data source, controller logic shouldn't be in data source methods. (One could even argue that it's doubly important to maintain this logical separation between functionality in a demo app, as that sort of app is presumably designed to illustrate best practice.)I think I should mention that this code $tableview->selectRow_byExtendingSelection($rows_ckpath-1, 0); $self->{'Window'}->display(); is located in numberOfRowsInTableView
What you should do is register your controller as a listener for controlTextDidEndEditing: notifications coming from the text field. In the method that handles these notifications, select the row you want, and give the input focus to the table view:
# Assume that $self->{'TableView'} is a connected outlet,
# and that $sel_row has been calculated
$self->{'TableView'}->selectRow_byExtendingSelection($sel_row, 0);
$self->{'Window'}->makeFirstResponder($self->{'TableView'});
sherm--
Welcome to Rivendell, Mr. Anderson.