NSPopUpButtonCell within NSTextFieldCell: disappearing text

Alan Smith alanrogersmith at gmail.com
Fri Aug 3 20:11:26 PDT 2007


Michael,

If you don't need the subclass to be a cell then I suggest making
things easier for yourself and subclassing NSTextField. That way you
can add the pop-up button as a sub-view.

If you would explain why you are attaching a pop-up button to a text
field it would be greatly appreciated.

It sounds like NSComboBox might be the kind of thing you are looking
for. If it helps any to know how NSComboBox works, the blue button
with the triangle on it is in fact a NSButton, or maybe a
NSButtonCell, I forget which. When the button is pressed a transparent
window with a table in it is popped up near the button. The editing
part is a NSTextField, again, it might be a cell, NSTextFieldCell.
Perhaps you'd find it easier to take this route and start from
scratch.

>From here it looks like if you are hooking up a NSPopUpButton to a
NSTextField and NSComboBox isn't the sort of thing you are trying to
accomplish you need to redesign your UI. By the way, it has been a
long time since I've seen NSComboBox used in a modern application. If
I have, they were disguised so I didn't notice.

Let me know why you need to do this, I'm curious.


Cheers, Alan


-- 
My blog: cocoalatte.info

// Things I've said -------------------------
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that personal beliefs are not something to
argue or fight over, it shall evolve."


More information about the MacOSX-dev mailing list