April 17, 2003

NSPopUpButton problems

Yay for the first Cocoa topic =]

I think that NSPopUpButton needs to be extended. It needs to be given a "setShowsImageWhenClosed:" and "showsImageWhenClosed" pair of methods. The reasoning for this is that I cannot seem to make a system where upon opening a popup menu you are given images for each item and then upon closing it you don't see that image anymore.
I have a system in place to do this. When an item is selected, I set the image for that item to nil. When the button pops up (via the notification), I re-add that image. This has the following two problems: a) It is slow to remove the image after selecting an item, which is very easily noticed if you look closely. The second, and the true reason why I feel such a setting should be added, is that if you open the menu and then click somewhere else in the window (not selecting a choice) the menu will close and the image will remain on the closed menu (a problem since usually your image will be quite a bit taller than the menu).

So yea, I'd like some comments on this one! Maybe someone has a solution I haven't seen? I wrote cocoa-dev about this without a response so I assume it's a fairly valid query.

Posted by Stevos at April 17, 2003 10:38 PM | TrackBack
  Post a comment

Remember personal info?