2

I want to make a widget that displays a column of selectable text data. It seems that the NSBrowser is the best cocoa object to do this but I cannot figure out how to populate the NSBrowser with any sort of data. I assume I can set the string value of an NsBrowserCell but no where in the documentation can I find where to add a new cell to a column. Am I using the wrong object?

Mike2012
  • 7,629
  • 15
  • 84
  • 135
  • 2
    “I want to make a widget that displays a column of selectable text data. It seems that the NSBrowser is the best cocoa object to do this …” Probably not. NSBrowser is for browsing hierarchies, like the file-system. You may recognize it as the Column View in Finder, Transmit, and a few other applications. An NSTableView may work better for what you have in mind. – Peter Hosey Apr 29 '10 at 05:08

1 Answers1

2

One must define a NSBrowserDelegate and define both ‑browser:willDisplayCell:atRow:column: and ‑browser:numberOfRowsInColumn: or the method ‑browser:createRowsForColumn:inMatrix:. This link is useful:

http://www.cocoabuilder.com/archive/cocoa/31229-nsbrowser-question.html

Rob Keniger
  • 45,830
  • 6
  • 101
  • 134
Mike2012
  • 7,629
  • 15
  • 84
  • 135