<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Styling an NSTableView (DTTAH)</title>
	<atom:link href="http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/feed/" rel="self" type="application/rss+xml" />
	<link>http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/</link>
	<description>Developing Interfaces with Cocoa</description>
	<pubDate>Wed, 10 Mar 2010 16:24:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Anonymous</title>
		<link>http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/#comment-345</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 16 Sep 2009 17:54:25 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=36#comment-345</guid>
		<description>And why all always consider that they rule;govern on all 100% Yes too faithfully</description>
		<content:encoded><![CDATA[<p>And why all always consider that they rule;govern on all 100% Yes too faithfully</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crucified</title>
		<link>http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/#comment-340</link>
		<dc:creator>crucified</dc:creator>
		<pubDate>Fri, 04 Sep 2009 23:20:03 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=36#comment-340</guid>
		<description>&lt;a href="http://Perchatkii.narod.ru/vinilovye-perchatki.html" rel="nofollow"&gt;</description>
		<content:encoded><![CDATA[<p><a href="http://Perchatkii.narod.ru/vinilovye-perchatki.html" rel="nofollow"></a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Satyam</title>
		<link>http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/#comment-294</link>
		<dc:creator>Satyam</dc:creator>
		<pubDate>Mon, 11 May 2009 02:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=36#comment-294</guid>
		<description>I am having some experience in programming Cocoa on Mac (but not a professional)
I downloaded the source code and understood how to get the custom cell into a table view. Very nice.
1. When I compiled and ran the code, it is displaying 5 rows with same custom cell. Is it possible, to have the rows added dynamically.
2. Next one is that, is it possible to bind the cells to NSArrayController so that the cells are automatically displaying the content of NSArrayController's objects attributes.
3. My current project implementation has NSTableView bind to NSArrayController. How can I integrate this with my current project.

Thanks,
--Satyam.</description>
		<content:encoded><![CDATA[<p>I am having some experience in programming Cocoa on Mac (but not a professional)<br />
I downloaded the source code and understood how to get the custom cell into a table view. Very nice.<br />
1. When I compiled and ran the code, it is displaying 5 rows with same custom cell. Is it possible, to have the rows added dynamically.<br />
2. Next one is that, is it possible to bind the cells to NSArrayController so that the cells are automatically displaying the content of NSArrayController&#8217;s objects attributes.<br />
3. My current project implementation has NSTableView bind to NSArrayController. How can I integrate this with my current project.</p>
<p>Thanks,<br />
&#8211;Satyam.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/#comment-293</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Wed, 06 May 2009 20:39:14 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=36#comment-293</guid>
		<description>Hi,
is there any best practice on how to get the data into a custom cell like used in the example (2strings one icon)? 
I found different ideas, for example: http://www.martinkahr.com/2006/11/04/data-for-a-custom-cell-in-a-nstableview/index.html

I liked the blog. It would love to see it continued :)</description>
		<content:encoded><![CDATA[<p>Hi,<br />
is there any best practice on how to get the data into a custom cell like used in the example (2strings one icon)?<br />
I found different ideas, for example: <a href="http://www.martinkahr.com/2006/11/04/data-for-a-custom-cell-in-a-nstableview/index.html" rel="nofollow">http://www.martinkahr.com/2006/11/04/data-for-a-custom-cell-in-a-nstableview/index.html</a></p>
<p>I liked the blog. It would love to see it continued <img src='http://katidev.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: corbin</title>
		<link>http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/#comment-156</link>
		<dc:creator>corbin</dc:creator>
		<pubDate>Fri, 11 Apr 2008 15:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=36#comment-156</guid>
		<description>Hey cathy,
I'm not the one to originally write the drop highlighting, but generally we make things private if we think there isn't a reason to override the behavior, or if we don't want people to override the behavior. Clearly, the drop highlighting was so ugly on Panther/Tiger that people wanted something better. It's better on Leopard, but I do understand that people still want custom tables and want the ability to control the drop highlighting. Also, thank's for mentioning radar numbers; it helps to know that you have logged a bug for this.
thanks,
corbin</description>
		<content:encoded><![CDATA[<p>Hey cathy,<br />
I&#8217;m not the one to originally write the drop highlighting, but generally we make things private if we think there isn&#8217;t a reason to override the behavior, or if we don&#8217;t want people to override the behavior. Clearly, the drop highlighting was so ugly on Panther/Tiger that people wanted something better. It&#8217;s better on Leopard, but I do understand that people still want custom tables and want the ability to control the drop highlighting. Also, thank&#8217;s for mentioning radar numbers; it helps to know that you have logged a bug for this.<br />
thanks,<br />
corbin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cathy</title>
		<link>http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/#comment-155</link>
		<dc:creator>Cathy</dc:creator>
		<pubDate>Fri, 11 Apr 2008 07:54:52 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=36#comment-155</guid>
		<description>Thanks, Corbin!  It really is much prettier in Leopard. :)

You probably can't answer this question, but I really really wonder - why are these particular methods are kept private?  I'd get it if they provided some critical functionality to the table, but they're just drawing methods.  Also, why are some of the drawing methods public and some private?  

I had to ask ;)</description>
		<content:encoded><![CDATA[<p>Thanks, Corbin!  It really is much prettier in Leopard. <img src='http://katidev.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You probably can&#8217;t answer this question, but I really really wonder - why are these particular methods are kept private?  I&#8217;d get it if they provided some critical functionality to the table, but they&#8217;re just drawing methods.  Also, why are some of the drawing methods public and some private?  </p>
<p>I had to ask <img src='http://katidev.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: corbin</title>
		<link>http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/#comment-154</link>
		<dc:creator>corbin</dc:creator>
		<pubDate>Fri, 11 Apr 2008 00:30:52 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=36#comment-154</guid>
		<description>And I should mention you should override this in your cell on Tiger:

- (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView

and return nil, or the appropriate color that you want.

corbin</description>
		<content:encoded><![CDATA[<p>And I should mention you should override this in your cell on Tiger:</p>
<p>- (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView</p>
<p>and return nil, or the appropriate color that you want.</p>
<p>corbin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: corbin</title>
		<link>http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/#comment-153</link>
		<dc:creator>corbin</dc:creator>
		<pubDate>Fri, 11 Apr 2008 00:24:42 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=36#comment-153</guid>
		<description>Unfortunately, the only way to customize the drop highlight stuff is to override the private methods. Yes, I've seen the bugs logged, but heck, it is much prettier in Leopard.

Notes: implement hitTestForEvent:inRect:ofView: to make your cell work when linked on Leopard.

You may be able to get away with not overriding _highlightColorForCell: on Tiger if you coordinate the cell's drawing. The problem is the cell; it uses that color to draw the highlighting.

corbin (the person john would ask).</description>
		<content:encoded><![CDATA[<p>Unfortunately, the only way to customize the drop highlight stuff is to override the private methods. Yes, I&#8217;ve seen the bugs logged, but heck, it is much prettier in Leopard.</p>
<p>Notes: implement hitTestForEvent:inRect:ofView: to make your cell work when linked on Leopard.</p>
<p>You may be able to get away with not overriding _highlightColorForCell: on Tiger if you coordinate the cell&#8217;s drawing. The problem is the cell; it uses that color to draw the highlighting.</p>
<p>corbin (the person john would ask).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cathy</title>
		<link>http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/#comment-135</link>
		<dc:creator>Cathy</dc:creator>
		<pubDate>Mon, 07 Apr 2008 07:06:22 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=36#comment-135</guid>
		<description>Drawing on top of NSTableView's drawing isn't really an option.  What if I design my line to be a 1 pixel thin red line?  NSTableView's thick black line would show underneath mine.  In my example project, the drop highlight is set to "clear color" by overriding a private method.  The default drawing in Leopard is a semi-transparent light blue rounded rect drawn above the cell.  How could I draw "clear" over that?  For the table's drawing not to show, I'd have to use an opaque color that will cover up the cell.

I'd also have to exactly recreate the calculations that determine when to draw a drop highlight on top of a row versus a line between the row and the row above or below.  If my implementation of this calculation is different from the table's by a pixel, its row highlight would flash for a fraction of a second while I'm still drawing a line between a row, or the other way around.

One thing about the regular selection highlight - if you're targeting anything before Leopard, there is a "bug" that causes the table to draw over your custom selection highlight.  You have to override their private method for selection color to see your custom highlight drawing, as I mention in the post.  This is &lt;a href="http://wilshipley.com/blog/2005/07/pimp-my-code-part-3-gradient.html" rel="nofollow"&gt;well known&lt;/a&gt; and it's fixed in Leopard.  

The only real solution that I can see is for the drop highlight methods to be made public. I've filed a bug report requesting this.  I can't think of a reason why these should be private other than the fact that Apple may not want us to customize the drawing for drag and drop.  If you do talk to someone about this, I'd be interested to hear their take on the matter.  Please keep me posted on what you learn : )

</description>
		<content:encoded><![CDATA[<p>Drawing on top of NSTableView&#8217;s drawing isn&#8217;t really an option.  What if I design my line to be a 1 pixel thin red line?  NSTableView&#8217;s thick black line would show underneath mine.  In my example project, the drop highlight is set to &#8220;clear color&#8221; by overriding a private method.  The default drawing in Leopard is a semi-transparent light blue rounded rect drawn above the cell.  How could I draw &#8220;clear&#8221; over that?  For the table&#8217;s drawing not to show, I&#8217;d have to use an opaque color that will cover up the cell.</p>
<p>I&#8217;d also have to exactly recreate the calculations that determine when to draw a drop highlight on top of a row versus a line between the row and the row above or below.  If my implementation of this calculation is different from the table&#8217;s by a pixel, its row highlight would flash for a fraction of a second while I&#8217;m still drawing a line between a row, or the other way around.</p>
<p>One thing about the regular selection highlight - if you&#8217;re targeting anything before Leopard, there is a &#8220;bug&#8221; that causes the table to draw over your custom selection highlight.  You have to override their private method for selection color to see your custom highlight drawing, as I mention in the post.  This is <a href="http://wilshipley.com/blog/2005/07/pimp-my-code-part-3-gradient.html" rel="nofollow">well known</a> and it&#8217;s fixed in Leopard.  </p>
<p>The only real solution that I can see is for the drop highlight methods to be made public. I&#8217;ve filed a bug report requesting this.  I can&#8217;t think of a reason why these should be private other than the fact that Apple may not want us to customize the drawing for drag and drop.  If you do talk to someone about this, I&#8217;d be interested to hear their take on the matter.  Please keep me posted on what you learn : )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John C. Randolph</title>
		<link>http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/#comment-134</link>
		<dc:creator>John C. Randolph</dc:creator>
		<pubDate>Mon, 07 Apr 2008 01:29:39 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=36#comment-134</guid>
		<description>I don't see a reason why you'd have to turn off the existing drawing behavior.  If NSTableView is drawing outside of the usual -drawRect: mechanism by doing its own -lockFocus and draw operations, you should still be able to draw over that by sending -setNeedsDisplayInRect: in your own -mouseMoved: or -draggingUpdated: methods that call through to the inherited implementations.

I can find out who's maintaining NSTableView these days and run it by him to be sure, but it seems to me that you should be able to achieve the effect you're after without resorting to overriding the private methods.

-jcr</description>
		<content:encoded><![CDATA[<p>I don&#8217;t see a reason why you&#8217;d have to turn off the existing drawing behavior.  If NSTableView is drawing outside of the usual -drawRect: mechanism by doing its own -lockFocus and draw operations, you should still be able to draw over that by sending -setNeedsDisplayInRect: in your own -mouseMoved: or -draggingUpdated: methods that call through to the inherited implementations.</p>
<p>I can find out who&#8217;s maintaining NSTableView these days and run it by him to be sure, but it seems to me that you should be able to achieve the effect you&#8217;re after without resorting to overriding the private methods.</p>
<p>-jcr</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 2.158 seconds -->
