1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

NSComboBox programmatically pop-up method

Discussion in 'Mac Programming' started by jivaro, Apr 21, 2012.

  1. macrumors newbie

    #1
    Is there any way of programmatically displaying a comboBox pop-up ?
     
  2. macrumors 6502

    #2
    Yes.
     
  3. macrumors newbie

    #3
    This is a GREAT new. Now, what is the way of doing it ??
     
  4. macrumors 6502

    #4
    Usually you would initialize the control, set some attributes, and add it to your window's content view, but without at least a little bit of help such as maybe OS and Xcode versions, language, exactly what you are wanting to do and what you have done so far, etc, you aren't going to get much help.
     
  5. jivaro, Apr 22, 2012
    Last edited by a moderator: Apr 22, 2012

    macrumors newbie

    #5
    I'm trying to develop an application for Mac OS X. I'm running a G5 with Mac OS X version 10.5.8 and XCode 3.1.4. I bought this Mac 2nd hand for 200 €. After decades of PCs this is my first Mac, I am loving it and I plan to buy myself a new Mac for my next anniversary.

    Now, going to my problem, I have implemented a piece of code allowing to (add and) remove items from a ComboBox:
    Code:
    	
    	NSString *comboEntry = [outletComboBoxCell stringValue];    // get comboBox entry
    	[outletComboBoxCell removeItemWithObjectValue:comboEntry];  // delete comboBox entry
    	[outletComboBoxCell setStringValue:@""];                    // set comboBoxCell to nul
    
    and I would like that after deleting an item from the ComboBox list, the pop-up list was displayed to show the rest of elements still there.

    I have googled the issue, and found nothing so far, only a reference to a popUp method that is not documented and I have not been able to make it work.

    I'm sure that there must be some solution to this issue, but I am not able to find it.
     
  6. macrumors 68000

    Sydde

    #6
    Can you explain why a combo box is the best choice for what you are trying to accomplish? To me, it sounds like a rather awkward tool for the kind of thing you are describing (editing a list).
     
  7. macrumors newbie

    #7
    Its hard to realize a simpler option: 3 lines of code and it's done .....
     

Share This Page