<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Important Shock]]></provider_name><provider_url><![CDATA[https://importantshock.wordpress.com]]></provider_url><author_name><![CDATA[Patrick Thomson]]></author_name><author_url><![CDATA[https://importantshock.wordpress.com/author/importantshock/]]></author_url><title><![CDATA[I got you a&nbsp;present!]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>[Update: Looks like <a href="http://www.mere-mortal-software.com/blog/">Dave Batton</a> <a href="http://www.mere-mortal-software.com/blog/details.php?d=2006-12-21">beat me to the punch</a>. *cries*]</p>
<p>Merry <strike>Atheist Children Get Presents Day</strike> Christmas, everyone!</p>
<p>In celebration of this day, I am giving you a gift &#8211; yes, a gift &#8211; from me to you. Yes, you. It is my first piece of public code &#8211; well, actually, that&#8217;s a lie. I posted <a href="http://textsnippets.com/posts/show/512">this</a> some months ago &#8211; I consider it my cleverest Java hack EVER. I&#8217;m quite proud of it. No! Digression!  Must&#8230;focus. Wait&#8230;my second was <a href="http://code.google.com/p/pies-email-shrouder/">this</a>.</p>
<p>Anyway, it&#8217;s my third piece of public code, and I hope you like it. In short, it&#8217;s called PVCGradientCell, and it&#8217;s a subclass of NSTextFieldCell that uses the CTGradient class to mimic the Source List found in iTunes 6. It&#8217;s notable for several reasons:</p>
<ol>
<li>Despite the name of the file (PVCGradientTable) , it is actually not a subclass of NSTableView &#8211; all the code is contained in the NSTextFieldCell subclass. This is unlike Matt Gemmell&#8217;s <a href="http://mattgemmell.com/source/">iTableView</a>, which requires subclassing of NSTableView. (By the way, props to Matt &#8211; his iTableView helped me fix a lot of bugs.)</li>
<li>It uses Chad Weider&#8217;s <a href="http://blog.oofn.net/2006/01/15/gradients-in-cocoa/">CTGradient</a> code to render the gradient &#8211; the majority of implementations use either stretching images or bare CoreImage code.</li>
<li>It allows you to enable centering the text vertically, a lá Daniel Jalkut&#8217;s <a href="http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes">RSVerticallyCenteredTextCell</a>.</li>
<li>It allows one to specify whether the text should be <strong>bold </strong>when clicked upon.</li>
<li>It freshens your breath.</li>
</ol>
<p>Here&#8217;s a screenshot, with the text bolded and vertically centered:</p>
<p><a href="https://importantshock.files.wordpress.com/2006/12/screenshot.png" title="PVCGradientScreenshot"><img src="https://importantshock.files.wordpress.com/2006/12/screenshot.png" alt="PVCGradientScreenshot" /></a></p>
<p>You can grab it <a href="http://tinyurl.com/yf3lfd">here</a>, or check it out from my Subversion repository (courtesy of <a href="http://www.assembla.com/portal">Assembla</a> &#8211; great job, guys!) here:<br />
<code><a href="http://tools.assembla.com/svn/importantshock" rel="nofollow">http://tools.assembla.com/svn/importantshock</a></code></p>
<p>Use the username and password &#8216;<code>anonymous</code>&#8216; (without quotes, of course) to access the repository.</p>
<p>Bug reports, accolades, fame, and large sacks of cash are welcome at:</p>
<p>ironswallow at gmail dot etc</p>
<p>By the way, PVC was the initial acronym for the Cocoa application I&#8217;m working on.</p>
<p>Anyway, I hope that y&#8217;all have a rockin&#8217; Christmas. Oh, and check out Scott Stevenson&#8217;s really neat <a href="http://theocacao.com/document.page/389">THCalendarInfo</a> present to you; it kinda owns my present in terms of complexity. (It reminds me of the <a href="http://www.deveiate.org/projects/Linguistics/">Ruby linguistics module</a> in terms of slickness and usefulness.)</p>
<p>Bye!</p>
]]></html><thumbnail_url><![CDATA[https://i2.wp.com/importantshock.wordpress.com/files/2006/12/screenshot.png?fit=440%2C330]]></thumbnail_url><thumbnail_width><![CDATA[230]]></thumbnail_width><thumbnail_height><![CDATA[330]]></thumbnail_height></oembed>