I am setting my NSBrowser
matrix cells' tool tips with the below code:
- (void) browser:(NSBrowser *)sender willDisplayCell:(id)cell atRow:(int)row column:(int)column {
NSMatrix *matrix = [sender matrixInColumn:column];
NSLog(@"'%@'", [cell title]);
[matrix setToolTip:[cell title] forCell:[matrix cellAtRow:row column:column]];
}
This results in wonderful tool tips, most of the time.
When hovering some cells, however, the tool tip expands to a grotesque width, transforming an otherwise delightful experience into one that is as hideous as it is confusing. The screenshot below shows this horrible behaviour.
The output for the cell triggering the heinous tool tip pictured above is:
'gnome-1.1-tb-linux.jar'
What could be causing these seemingly random atrocities - am I missing something obvious?
A solution that worked for me in this case was to implement
- (NSRect)expansionFrameWithFrame:(NSRect)cellFrame inView:(NSView *)view
in myNSBrowserCell
subclass as below: