Re: nspopupbuttoncell attribs
Re: nspopupbuttoncell attribs
- Subject: Re: nspopupbuttoncell attribs
- From: Peter Ammon <email@hidden>
- Date: Mon, 11 Feb 2008 12:08:35 -0800
On Feb 10, 2008, at 8:20 PM, William Zumwalt wrote:
Hi,
I've got two questions releated to NSPopUpButtonCell.
In my dataCellForRow: method, I'm trying to set the text color but
I'm not
finding a way to do this with an NSPopUpButtonCell like there is for
NSTextFieldCell which uses setTextColor:. How is this done?
Hi William,
To change the text color of an NSPopUpButtonCell, you should set its
menuItem attributed title to a colored string.
Of course, this will also change the color of the menu item in the
menu. If you want the menu item to draw black but the title to draw
blue, you should override -[NSPopUpButtonCell drawTitle: withFrame:
inView:], replace the passed in attributed title to something blue,
and call super with it.
Also, in this same method and same control, I'm trying to get rid
of the
checkbox that appears when the popup is enabled in order to match
the text
alignment of the NSPopUpButtonCell with the other NSTextFieldCell's
in the
same column so that they are all left aligned.
...
The setState: isn't making the checkbox go away which is my
understanding of
what it's for. What am I doing wrong there?
You lost me here....I think you mean checkmark instead of checkbox,
but even so, the checkmark should not appear in the popup button,
only in its menu. Can you provide a screenshot of what you're seeing?
If you want to remove the checkmark space from the menu, you can use -
[menu setShowsMarkColumn:NO], but be aware that the title in the menu
and in the popup button may no longer line up when the menu is opened.
-Peter
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden