1from Cocoa import * 2 3RowSelectedNotification = "RowSelectedNotification" 4 5class SelectionNotifyMatrix (NSMatrix): 6 def mouseDown_(self, theEvent): 7 super(SelectionNotifyMatrix, self).mouseDown_(theEvent) 8 9 row = self.selectedRow() 10 #print "mouseDown_", theEvent, row 11 if row != -1: 12 NSNotificationCenter.defaultCenter( 13 ).postNotificationName_object_userInfo_( 14 RowSelectedNotification, 15 self, 16 None) 17 18 def selectCellAtRow_column_(self, row, col): 19 super(SelectionNotifyMatrix, self).selectCellAtRow_column_(row, col) 20 21 NSNotificationCenter.defaultCenter( 22 ).postNotificationName_object_userInfo_( 23 RowSelectedNotification, 24 self, 25 None) 26