Re: NSButton Colour?
Re: NSButton Colour?
- Subject: Re: NSButton Colour?
- From: Ondra Cada <email@hidden>
- Date: Tue, 17 Sep 2002 14:11:52 +0200
On Tuesday, September 17, 2002, at 08:23 , Colin Doncaster wrote:
Sorry for such a simple question, but how do I change the colour of a
button?
Generally, you don't. The main reason is that Apple does not want us to do
that. The technical one is that, so far as I know (did not check myself!)
actually a bitmap image is used for the background, and thus the change is
non-trivial.
It seems like such a simple thing but it doesn't want to change. It
seems like a lot of things have the setBackgroundColor member function
but NSButton doesn't.
Check the archives -- some time ago (a few months, IIRC) this was
discussed and even some sample code I kind of recall was posted. The trick
is to get the image, and change its pixels' colours. Non trivial of course
-- the more reason not to do that (unless really inevitable).
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.