Re: tableSelectionDidChange
Re: tableSelectionDidChange
- Subject: Re: tableSelectionDidChange
- From: Ondra Cada <email@hidden>
- Date: Thu, 30 Aug 2001 21:03:08 +0200
Darin,
>
>>>>> Darin Duphorne (DD) wrote at Thu, 30 Aug 2001 12:19:32 -0500:
DD> I have a working tableView which populates based on textFields and
DD> action buttons. How would I implement tableSelectionDidChange
DD> notification to, for example, populate the text fields again with the
DD> values of the columns in a selected row?
I am not sure I understand you well -- do you mean this?
...
[center addObserver:self selector:@selector(xyz:)
name:NSTableViewSelectionDidChangeNotification object:nil];
...
-(void)xyz:(NSNotification*)nn {
NSTableView *tv=[nn object];
int row=[tv selectedRow];
if (row<0) ... clear fields ...
else ... set fields to values from [tv dataSource], using rowIndex:row ...
}
It's that simple.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc