Skip navigation.
 
mlNSPopUpButton displaying custom title
FROM : Nicholas Riley
DATE : Thu Jan 10 22:04:02 2002

Hi,

I would like to have a NSPopUpButton display something other than the
selected menu item text, or nothing, as appear to be the only choices.
(I would like it to display an abbreviated version of the selected
item, actually, minus some spacing and explanatory text that is part
of the menu item text).

I can think of two ways to possibly to do this.  I haven't implemented
either, so I don't know whether they're possible in exactly the
fashion I mention, but I was hoping that someone would suggest an
easier method...

1. Use setUsesItemFromMenu: NO and place a NSTextField over the top of
  the button, then set the button text when an item is selected.

2. When an item is selected, change the menu item text.  When the
  menu is popped up, change the text back to what it was before.

What I don't understand is why I can't just use setTitle: when
setUsesItemFromMenu is NO; it just has no effect.

Any advice appreciated.

Thanks,

--
=Nicholas Riley <<email_removed>> | <http://www.uiuc.edu/ph/www/njriley>
        Pablo Research Group, Department of Computer Science and
  Medical Scholars Program, University of Illinois at Urbana-Champaign

Related mailsAuthorDate
No related mails found.