Ram
Ram

Reputation: 1890

How to highlight a row in NSBrowser?

I tried to highlight the rows in a NSBrowser using selectRowIndexes of the NSBrowser,but it does not highlight the rows.In 'NSTableView`rows can be highlighted using

 - [NSTableView selectRowIndexes:byExendingSelection:]

  - (void)selectRowIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger).

Is there any api to highlight the rows in NSBrowser? I would like to highlight the rows without a mouseclick on the browser,I have some known indexes I want to highlight these rows in my custom method.

Upvotes: 0

Views: 401

Answers (1)

jackjr300
jackjr300

Reputation: 7191

To select the first five rows in the first column :

NSIndexSet *indexes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0,4)];
[myNSBrowser selectRowIndexes:indexes inColumn:0];

To select the fourth row in the first column :

[myNSBrowser selectRow:3 inColumn:0];

Upvotes: 1

Related Questions