Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set column title on OS X 10.9. #497

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions darwin/tablecolumn.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ - (uiprivTableCellView *)uiprivMakeCellView
return nil; // appease compiler
}

static void setTitle(uiprivTableColumn *col, NSString *str)
{
if ([col respondsToSelector:@selector(setTitle:)]) {
[col setTitle:str];
} else {
[[col headerCell] setStringValue:str];
}
}

@end

struct textColumnCreateParams {
Expand Down Expand Up @@ -599,7 +608,7 @@ void uiTableAppendTextColumn(uiTable *t, const char *name, int textModelColumn,

str = [NSString stringWithUTF8String:name];
col = [[uiprivTextImageCheckboxTableColumn alloc] initWithIdentifier:str params:&p];
[col setTitle:str];
setTitle(col, str);
[t->tv addTableColumn:col];
}

Expand All @@ -618,7 +627,7 @@ void uiTableAppendImageColumn(uiTable *t, const char *name, int imageModelColumn

str = [NSString stringWithUTF8String:name];
col = [[uiprivTextImageCheckboxTableColumn alloc] initWithIdentifier:str params:&p];
[col setTitle:str];
setTitle(col, str);
[t->tv addTableColumn:col];
}

Expand All @@ -645,7 +654,7 @@ void uiTableAppendImageTextColumn(uiTable *t, const char *name, int imageModelCo

str = [NSString stringWithUTF8String:name];
col = [[uiprivTextImageCheckboxTableColumn alloc] initWithIdentifier:str params:&p];
[col setTitle:str];
setTitle(col, str);
[t->tv addTableColumn:col];
}

Expand All @@ -665,7 +674,7 @@ void uiTableAppendCheckboxColumn(uiTable *t, const char *name, int checkboxModel

str = [NSString stringWithUTF8String:name];
col = [[uiprivTextImageCheckboxTableColumn alloc] initWithIdentifier:str params:&p];
[col setTitle:str];
setTitle(col, str);
[t->tv addTableColumn:col];
}

Expand Down Expand Up @@ -693,7 +702,7 @@ void uiTableAppendCheckboxTextColumn(uiTable *t, const char *name, int checkboxM

str = [NSString stringWithUTF8String:name];
col = [[uiprivTextImageCheckboxTableColumn alloc] initWithIdentifier:str params:&p];
[col setTitle:str];
setTitle(col, str);
[t->tv addTableColumn:col];
}

Expand All @@ -704,7 +713,7 @@ void uiTableAppendProgressBarColumn(uiTable *t, const char *name, int progressMo

str = [NSString stringWithUTF8String:name];
col = [[uiprivProgressBarTableColumn alloc] initWithIdentifier:str table:t model:t->m modelColumn:progressModelColumn];
[col setTitle:str];
setTitle(col, str);
[t->tv addTableColumn:col];
}

Expand All @@ -715,6 +724,6 @@ void uiTableAppendButtonColumn(uiTable *t, const char *name, int buttonModelColu

str = [NSString stringWithUTF8String:name];
col = [[uiprivButtonTableColumn alloc] initWithIdentifier:str table:t model:t->m modelColumn:buttonModelColumn editableColumn:buttonClickableModelColumn];
[col setTitle:str];
setTitle(col, str);
[t->tv addTableColumn:col];
}