Re: Sourcelist background colors
On Jun 24, 2008, at 12:57 PM, Markus Spoettl wrote: Hello List, is there a way to get the background color of an NSOutlineView when in sourcelist mode (for both key and non-ket state)? Yes. It is a magical NSColor that draws correctly depending on the window key-state. Create an NSOutlineView, set it to be a source list, and get the -backgroundColor. Keep it around and use it as you wish. Be sure to redisplay your view when the window looses key-ness. corbin NSColor doesn't seem to define the color. If not, is there a way to derive the color somehow, by blending or highlighting with another system defined color? Thanks for any pointers! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Sourcelist background colors
Hi Corbin, On Jun 25, 2008, at 10:28 AM, Corbin Dunn wrote: Yes. It is a magical NSColor that draws correctly depending on the window key-state. Create an NSOutlineView, set it to be a source list, and get the -backgroundColor. Keep it around and use it as you wish. Be sure to redisplay your view when the window looses key-ness. Excellent, thanks for the information! Works perfectly. Regards Markus -- __ Markus Spoettl smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Sourcelist background colors
Be sure to redisplay your view when the window looses key-ness. How would this be achieved? I've been trying to figure it out, I'm sure there's something simple eluding me. Keith ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Sourcelist background colors
On Jun 25, 2008, at 3:33 PM, Keith Duncan wrote: Be sure to redisplay your view when the window looses key-ness. How would this be achieved? I've been trying to figure it out, I'm sure there's something simple eluding me. It appears to me that the view/window will repaint when the hosting window looses/gains -isMainWindow status (at least my window does that). So all you need to do is using -backgroundColor dynamically, whenever you redraw the view. The background color changes automatically and you don't have to update manually. Regards Markus -- __ Markus Spoettl smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Sourcelist background colors
On Jun 25, 2008, at 3:52 PM, Markus Spoettl wrote: On Jun 25, 2008, at 3:33 PM, Keith Duncan wrote: Be sure to redisplay your view when the window looses key-ness. How would this be achieved? I've been trying to figure it out, I'm sure there's something simple eluding me. It appears to me that the view/window will repaint when the hosting window looses/gains -isMainWindow status (at least my window does that). That may be a fluke -- certain views might do this, but not all. It is best to watch the appropriate notifications for your window: NSWindowDidBecomeKeyNotification NSWindowDidResignKeyNotification So all you need to do is using -backgroundColor dynamically, whenever you redraw the view. The background color changes automatically and you don't have to update manually. Yes, that's correct. It is a magical color. --corbin ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Sourcelist background colors
On Jun 25, 2008, at 4:09 PM, Corbin Dunn wrote: That may be a fluke -- certain views might do this, but not all. It is best to watch the appropriate notifications for your window: NSWindowDidBecomeKeyNotification NSWindowDidResignKeyNotification My view is a custom NSView subclass, I'm not sure NSView is supposed to do this automatically by default. Anyway, thanks for the warning, I've changed my view to get notified explicitly. Regards Markus -- __ Markus Spoettl smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Sourcelist background colors
Sourcelist active background color: RGB(214, 221, 229) (#d6dde5) Sourcelist inactive background color: RGB(232, 232, 232) (#e8e8e8) I got this by taking two screenshots and using the color palette's magnifying glass. This is what you're looking for, right? HTH, Dave On Tue, Jun 24, 2008 at 1:57 PM, Markus Spoettl [EMAIL PROTECTED] wrote: Hello List, is there a way to get the background color of an NSOutlineView when in sourcelist mode (for both key and non-ket state)? NSColor doesn't seem to define the color. If not, is there a way to derive the color somehow, by blending or highlighting with another system defined color? Thanks for any pointers! Regards Markus ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Sourcelist background colors
On Jun 24, 2008, at 1:13 PM, Dave DeLong wrote: Sourcelist active background color: RGB(214, 221, 229) (#d6dde5) Sourcelist inactive background color: RGB(232, 232, 232) (#e8e8e8) I got this by taking two screenshots and using the color palette's magnifying glass. This is what you're looking for, right? Yes and no. Measuring the actual RGB values gives you what your system is displaying it with at the moment, not the computation that leads to that color - assuming such a computation takes place. Whether or not those are fixed values, I don't know. I guess that's part of the question (only Apple might be able to answer). I should have been more careful when asking. Sorry. Thanks for your suggestion! Regards Markus -- __ Markus Spoettl smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]