Re: NSCell interiorBackgroundStyle wrong?
Re: NSCell interiorBackgroundStyle wrong?
- Subject: Re: NSCell interiorBackgroundStyle wrong?
- From: Kyle Sluder <email@hidden>
- Date: Fri, 31 May 2013 14:11:54 -0700
On Fri, May 31, 2013, at 01:42 PM, Seth Willits wrote:
> In my case, since the cell does not draw its own background, the
> interiorBackgroundStyle should simply be whatever the backgroundStyle is,
> right?
backgroundStyle refers to the style of the _container_ relative to the
_control_. That's why it has a setter.
interiorBackgroundStyle refers to the style of _some of the cell's
drawing_ related to _some of the cell's other drawing_. That's why it
doesn't have a setter, because all the state that affects it is
contained within the cell.
Take the buttons on the Safari bookmarks bar, for example. The toolbar
probably sets their background style to NSBackgroundStyleLight. This
makes sense, because the _container_ knows what kind of background it is
drawing behind the controls. The button cells themselves probably return
NSBackgroundStyleRaised for their -interiorBackgroundStyle, because that
corresponds to the relationship between the background the cell draws
(none) and the label it draws (etched in).
> So the correct solution involves overriding the editing-related methods
> and setting an internal flag to know when editing is happening, and
> return NSBackgroundLight when editing, otherwise return
> self.backgroundStyle. Ugh.
Can you instead just override -setUpFieldEditorAttributes: to call super
and then trump its decisions?
>
> I think _textAttributes should be made public, especially given that
> -attributedStringValue is never even called.
Yes, the relationship between attributed string values, text cells, and
the field editor is quite murky, and we could cut through it all if we
had direct access to the cell's text system.
--Kyle Sluder
_______________________________________________
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