Re: [Pyobjc-dev] shouldSelectRow not working as expected
Brought to you by:
ronaldoussoren
From: <bo...@pa...> - 2003-02-28 06:56:42
|
Hi Chris, good suggestion. i enabled column selection in IB, and this delegate method still runs and still permits column selecting. def tableView_shouldSelectTableColumn_(self, aTableView, aTableColumn): print "select table?" return 0==1 i think there's something wrong with the call linkages for boolean return types, but i can't figure out what it is. if anybody else can get this to actually work on TableModel2, i'd be interested to know how. --bob On Thursday, February 27, 2003, at 07:17 PM, Chris Ryland wrote: > 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 > |