Re: Live resizing NSTableView causes ghosting/nastiness in custom drawn NSTextFieldCell
Re: Live resizing NSTableView causes ghosting/nastiness in custom drawn NSTextFieldCell
- Subject: Re: Live resizing NSTableView causes ghosting/nastiness in custom drawn NSTextFieldCell
- From: Corbin Dunn <email@hidden>
- Date: Mon, 02 Mar 2009 08:02:48 -0800
On Feb 27, 2009, at 4:02 PM, Andrew Yeaton wrote:
I have a custom subclass of an NSTextFieldCell that draws a right-
aligned "badge" (like Mail.app's unread count). The column that uses
the custom cell autoresizes with the width of the NSTableView (which
resizes with the window).
The problem:
When the width of the column expands quickly, the cell width doesn't
resize smoothly and seems to have ghosting.
My drawing code seems to be working, but appears to be drawing
"under" a cached version from the original width. It's as if, my
draw is happening correctly, but a cached image is being placed over
top anyway.
Is there a way to make the column resize smoothly and draw correctly?
Ideally, overriding -preservesContentDuringLiveResize and returning NO
should work, but unfortunately does not (this is a known problem).
Instead, subclass NSTableView, override -drawRect:, and call [super
drawRect:]. The "custom" drawing will turn off live-resize caching.
corbin
_______________________________________________
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