Skip to content

Commit

Permalink
Notify when a CPTableView column moves.
Browse files Browse the repository at this point in the history
Both through `CPNotificationCenter` and to the delegate.
  • Loading branch information
aljungberg committed Jul 17, 2012
1 parent e68077d commit 9b77f1b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions AppKit/CPTableView.j
Expand Up @@ -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"]]];
}

/*!
Expand Down

0 comments on commit 9b77f1b

Please sign in to comment.