From 9b77f1b7acf1e229a78aedaf34c4799cc0ee5a61 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Tue, 17 Jul 2012 22:57:36 +0100 Subject: [PATCH] Notify when a `CPTableView` column moves. Both through `CPNotificationCenter` and to the delegate. --- AppKit/CPTableView.j | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index c4ae1ac97..61045d64e 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -978,6 +978,13 @@ NOT YET IMPLEMENTED columnIndexes = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(fromIndex, toIndex)]; [self reloadDataForRowIndexes:rowIndexes columnIndexes:columnIndexes]; + + // Notify even if programmatically moving a column as in Cocoa. + // TODO Only notify when a column drag operation ends, not each time a column reaches a new slot? + [[CPNotificationCenter defaultCenter] postNotificationName:CPTableViewColumnDidMoveNotification + object:self + userInfo:[CPDictionary dictionaryWithObjects:[fromIndex, toIndex] + forKeys:[@"CPOldColumn", @"CPNewColumn"]]]; } /*!