Can't change image of NSPopupButton
Can't change image of NSPopupButton
- Subject: Can't change image of NSPopupButton
- From: Rainer Brockerhoff <email@hidden>
- Date: Wed, 20 Mar 2002 17:21:21 -0300
Hi folks.
I must be doing something extremely stupid here... by now, I'm able to do some very complex things in Cocoa that usually run on the first try, but simple things can take days :-).
Anyway, I have a square shadowed NSPopupButton that has an empty title, but uses an image which changes according to context. The button is in pulldown mode.
Setting an image in Interface Builder results of course in the image being displayed (except for the quirks detailed below). Calling [popupButton image] returns the image I've set.
However, changing the image with [popupButton setImage:[NSImage imageNamed:@"something"]] has no effect at all. Shouldn't I be able to change the image at any time?
Two quirks I've noticed: first, one of the images I need to show in the NSPopupButton is called "none.tiff". If I set this in IB, it displays correctly. When running the program, the image isn't displayed and the log shows error messages like "couldn't cache image". It seems that "none" is a reserved name that can't be used in NSImage???
Second, IB is case-sensitive for image file names - if you use the wrong case, the broken image icon is shown, but it runs correctly later.
TIA,
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"I love deadlines. I love the whooshing noise they make as they go by" (Douglas Adams)
http://www.brockerhoff.net/ (updated Feb. 2002)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.