Re: [Pyobjc-dev] shouldSelectRow not working as expected
Brought to you by:
ronaldoussoren
From: Chris R. <cp...@em...> - 2003-02-28 03:16:36
|
Bob-- Perhaps the BOOL return value is really what's needed, so you need to return YES or NO? On Thursday, February 27, 2003, at 07:52 PM, Bob Pasker wrote: > def tableView_shouldSelectRow_(self, aTableView, rowIndex): > print "shouldSelectRow %d is %d" % (rowIndex, rowIndex % 2) > return rowIndex % 2 Try return (rowIndex % 2) == 1 which should normalize to a true boolean value, or, perhaps more safely (is it necessary?), if (rowIndex % 2) == 1 return YES else return NO (or, if the latest conditional expression PEP gets approved ;-), return if (rowIndex % 2 == 1): YES else: NO Cheers! --Chris Ryland / Em Software, Inc. / www.emsoftware.com |