Re: Repositioning an NSTextFieldCell?
Re: Repositioning an NSTextFieldCell?
- Subject: Re: Repositioning an NSTextFieldCell?
- From: Matt Neuburg <email@hidden>
- Date: Sat, 25 Nov 2006 10:00:29 -0800
- Thread-topic: Repositioning an NSTextFieldCell?
On or about 11/25/06 9:10 AM, thus spake "Daniel Jalkut"
<email@hidden>:
> did the NSTextField happen to be configured
> to draw its background?
Yes. :)
What I actually wanted to make was what I call a "padded cell" (no jokes,
please) - a cell in an NSTextField that provides more space between the edge
and the text than Apple's default (which I strongly dislike the look of).
This is indeed in an NSTextField that draws its own background, and the way
I ended up doing it is like this:
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
[[self backgroundColor] set];
NSRectFill(NSInsetRect(cellFrame,1.0,1.0));
[super drawInteriorWithFrame:
NSInsetRect(cellFrame, 3.0, 1.0) inView:controlView];
}
However, my cell is not editable and clearly more code would be needed if it
were. That's why I was hoping to mind-meld my code to yours... m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide - Second Edition!
http://www.amazon.com/gp/product/0596102119
Take Control of Word 2004, Tiger, and more -
http://www.takecontrolbooks.com/tiger-customizing.html
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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