Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 21, 2012, 12:02 PM   #1
jivaro
macrumors newbie
 
Join Date: Apr 2012
Location: Cornella de Llobregat (Spain)
NSComboBox programmatically pop-up method

Is there any way of programmatically displaying a comboBox pop-up ?
jivaro is offline   0 Reply With Quote
Old Apr 21, 2012, 03:16 PM   #2
Red Menace
macrumors regular
 
Join Date: May 2011
Location: Littleton, Colorado, USA
Yes.
__________________
MacBook Pro / OS X Mavericks (10.9.2) / Xcode 5.1 / [and various (much) older stuff keeping dust off the shelves]
Red Menace is offline   0 Reply With Quote
Old Apr 21, 2012, 04:17 PM   #3
jivaro
Thread Starter
macrumors newbie
 
Join Date: Apr 2012
Location: Cornella de Llobregat (Spain)
Quote:
Originally Posted by Red Menace View Post
Yes.
This is a GREAT new. Now, what is the way of doing it ??
jivaro is offline   0 Reply With Quote
Old Apr 21, 2012, 04:54 PM   #4
Red Menace
macrumors regular
 
Join Date: May 2011
Location: Littleton, Colorado, USA
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.
__________________
MacBook Pro / OS X Mavericks (10.9.2) / Xcode 5.1 / [and various (much) older stuff keeping dust off the shelves]
Red Menace is offline   0 Reply With Quote
Old Apr 22, 2012, 03:42 AM   #5
jivaro
Thread Starter
macrumors newbie
 
Join Date: Apr 2012
Location: Cornella de Llobregat (Spain)
Quote:
Originally Posted by Red Menace View Post
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.
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.

Last edited by maflynn; Apr 22, 2012 at 02:21 PM. Reason: code tags added
jivaro is offline   0 Reply With Quote
Old Apr 22, 2012, 07:28 AM   #6
Sydde
macrumors 68000
 
Sydde's Avatar
 
Join Date: Aug 2009
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).
__________________
You got to be a spirit. You can't be no ghost.
Sydde is offline   0 Reply With Quote
Old Apr 22, 2012, 11:11 AM   #7
jivaro
Thread Starter
macrumors newbie
 
Join Date: Apr 2012
Location: Cornella de Llobregat (Spain)
Quote:
Originally Posted by Sydde View Post
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).
Its hard to realize a simpler option: 3 lines of code and it's done .....
jivaro is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:30 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC