Where is the Cocoa listbox documentation?

Discussion in 'Mac Programming' started by resander, May 7, 2008.

  1. resander macrumors newbie

    Apr 12, 2008
    I am still doing my homework before trying to port
    some Windows programs to Mac OS X.

    I have found programming documentation for Cocoa buttons,
    including checkboxes and radio buttons as well as text
    edit controls, but where are the docs describing how to
    program Cocoa listboxes?
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    Listbox? I assume that's the name of a Windows control?

    In Cocoa we have NSPopupButtons if you want a pop-up or pull-down menu or NSTableView (a 1 column table view with no header on the column is essentially a list).
  3. resander thread starter macrumors newbie

    Apr 12, 2008
    Yep - many thanks!

    The Windows, Javascript and Java listbox corresponds to a
    one-dimensional NSTableView without header.

    Windows has two-dimensional views too, but I don't remember
    if they support tableheaders.

    The NSPopup control is nearly the same as a Windows combobox
    without a scrollbar.

    When looking for the Cocoa listbox I stumbled upon
    NSComboBox, so Cocoa supports combo boxes too.
  4. robbieduncan Moderator emeritus


    Jul 24, 2002
    Erm yes, no-one ever said it didn't :confused:

    And could you let the forums wrap your posts instead of putting your own line returns in please: it's really annoying.
  5. Eraserhead macrumors G4


    Nov 3, 2005
    NSPopUpButton shouldn't be used if the number of entries is large enough to require scrolling, really it should only be used for a small number of items.

    Picture 1.png

    This example has too many items in it, but shows they do scroll if required.
  6. MobiusStrip macrumors regular

    Dec 11, 2009
    It's pretty much a standard widget across several platforms.

    I found this thread for the same reason: Scouring the controls in Interface Builder revealed no listbox. Thanks.

Share This Page