Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

object-attribute callback takes tableview parameter for altering beha…

…vior when rows are selected
  • Loading branch information...
commit 9c521d872a37be91c31daee5c0c9cf7774e8f387 1 parent f8c48f0
Zachary Schneirov authored
Showing with 11 additions and 8 deletions.
  1. +6 −4 NoteAttributeColumn.h
  2. +5 −4 NoteAttributeColumn.m
View
10 NoteAttributeColumn.h
@@ -2,11 +2,13 @@
#import <Cocoa/Cocoa.h>
+@class NotesTableView;
+
@interface NoteAttributeColumn : NSTableColumn {
NSInteger (*sortFunction) (id*, id*);
NSInteger (*reverseSortFunction) (id*, id*);
- id (*objectAttribute) (id);
+ id (*objectAttribute) (id, id);
SEL mutateObjectSelector;
float absoluteMinimumWidth;
@@ -15,11 +17,11 @@
+ (NSDictionary*)standardDictionary;
SEL columnAttributeMutator(NoteAttributeColumn *col);
- (void)setMutatingSelector:(SEL)selector;
-id columnAttributeForObject(NoteAttributeColumn *col, id object);
+id columnAttributeForObject(NotesTableView *tv, NoteAttributeColumn *col, id object);
- (void)updateWidthForHighlight;
-id (*dereferencingFunction(NoteAttributeColumn *col))(id);
-- (void)setDereferencingFunction:(id (*)(id))attributeFunction;
+id (*dereferencingFunction(NoteAttributeColumn *col))(id, id);
+- (void)setDereferencingFunction:(id (*)(id, id))attributeFunction;
- (void)setSortingFunction:(NSInteger (*)(id*, id*))sortFunction;
- (NSInteger (*)(id*, id*))sortFunction;
View
9 NoteAttributeColumn.m
@@ -1,4 +1,5 @@
#import "NoteAttributeColumn.h"
+#import "NotesTableView.h"
@implementation NoteAttributeColumn
@@ -36,11 +37,11 @@ - (void)setMutatingSelector:(SEL)selector {
mutateObjectSelector = selector;
}
-id columnAttributeForObject(NoteAttributeColumn *col, id object) {
- return col->objectAttribute(object);
+id columnAttributeForObject(NotesTableView *tv, NoteAttributeColumn *col, id object) {
+ return col->objectAttribute(tv, object);
}
-- (void)setDereferencingFunction:(id (*)(id))attributeFunction {
+- (void)setDereferencingFunction:(id (*)(id, id))attributeFunction {
objectAttribute = attributeFunction;
}
@@ -59,7 +60,7 @@ - (void)setReverseSortingFunction:(NSInteger (*)(id*, id*))aFunction {
- (NSInteger (*)(id*, id*))reverseSortFunction {
return reverseSortFunction;
}
-id (*dereferencingFunction(NoteAttributeColumn *col))(id) {
+id (*dereferencingFunction(NoteAttributeColumn *col))(id, id) {
return col->objectAttribute;
}
Please sign in to comment.
Something went wrong with that request. Please try again.