Re: background of NSButton and NSPopUpButton
Re: background of NSButton and NSPopUpButton
- Subject: Re: background of NSButton and NSPopUpButton
- From: Don Willems <email@hidden>
- Date: Thu, 25 Nov 2004 22:11:33 +0100
That is quickly done, just make the NSRect in which the cell is drawn
smaller:
How easy can it be ;-)
The biggest problem now is highlighting, if I click a button, the
button background becomes white, not aqua blue.
Okay, I am not sure how to go about this. You could subclass
NSButtonCell and play around with the -highlight:withFrame:inView:
method.
My first thought was overriding - (NSColor
*)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView
*)controlView to change the color of the highlight to a blue
semi-transparent highlight.
But I think it will not be very trivial to implement the typical aqua
semi-transparent blue glow. Maybe you can work with exchanging the
background image by a highlighted one?
That (although less generic) might be the best (most beautiful) idea.
I've been playing around some with subclassing NSButtonCell, but I just
can't get it to work. None of the methods in my subclass gets called. I
tried to set the Cell class with +setCellClass in NSControl, I've
overridden +cellClass, also in NSControl to return my subclass. But
nothing seems to have any effect.
The only thing that had some effect was using setCell, but that
resulted in ugly windows like buttons without an image.
How do you change the cell of a button?
Thanks for your help,
Don
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden