{"id":29,"date":"2007-09-08T13:39:49","date_gmt":"2007-09-08T21:39:49","guid":{"rendered":"http:\/\/www.latenightsw.com\/blog\/?p=45"},"modified":"2010-11-14T15:42:18","modified_gmt":"2010-11-14T22:42:18","slug":"sourcelistview","status":"publish","type":"post","link":"http:\/\/markalldritt.com\/?p=29","title":{"rendered":"SourceListView"},"content":{"rendered":"<p><strong>UPDATE<\/strong>: I have <a href=\"http:\/\/blog.latenightsw.com\/?p=352\">released an updated version of this sample<\/a> that takes advantage of improvements Apple made in Leopard (Mac OS X 10.5).<\/p>\n\n<p><strong><a href=\"http:\/\/www.latenightsw.com\/blog\/wp-content\/uploads\/2007\/09\/sourcelist10.zip\">Download SourceListView<\/a><\/strong><\/p>\n\n<p>I&#8217;ve been looking for a SourceList outline view for <a href=\"http:\/\/www.latenightsw.com\/blog\/?page_id=38\">FaceSpan<\/a> that I can use under Mac OS X 10.4.  A bunch of Googling revealed parts of the puzzle, but nothing that pulled all the pieces together.  So I decided to produce my own SourceList view using the pieces I found.<\/p>\n\n<p>I used iPhoto &#8217;08, iTunes 7, Numbers &#8217;08 and Mail as models.  Here are the elements of the SourceList views in these applications that seem to be different from the stock NSTableView\/NSOutlineView:<\/p>\n\n<ol>\n<li>Light blue background color<\/li>\n<li>Darker blue or blue gradient selection background<\/li>\n<li>The selection background color does <em>not<\/em> honor the system&#8217;s selection color preference<\/li>\n<li>Source Groups are not selectable<\/li>\n<li>Source Groups are drawn All Caps, Bold, Gray with a white shadow (appear embossed into the background)<\/li>\n<li>Source Group rows are a little taller than the others<\/li>\n<li>When inactive, the selection background turns gray, and the text switches from white to black<\/li>\n<li>The disclosure triangles are smaller than the ones provided by NSOutlineView (I&#8217;ve still not figured out how to accomplish this).<\/li>\n<\/ol>\n\n<p>Here&#8217;s what I came up with:<\/p>\n\n<p>Gradient Selection background (thank&#8217;s to <a href=\"http:\/\/mattgemmell.com\/source\">Matt Gemmell&#8217;s iTableView<\/a>):<\/p>\n\n<p><img id=\"image48\" src=\"http:\/\/www.latenightsw.com\/blog\/wp-content\/uploads\/2007\/09\/itunessourcelist.jpg\" alt=\"itunessourcelist.jpg\" \/><\/p>\n\n<p>Flat Selection background:<\/p>\n\n<p><img id=\"image47\" src=\"http:\/\/www.latenightsw.com\/blog\/wp-content\/uploads\/2007\/09\/numberssourcelist.jpg\" alt=\"numberssourcelist.jpg\" \/><\/p>\n\n<p>Matt Gemmell&#8217;s license seems reasonable, so I&#8217;m releasing the SourceList code under his <a href=\"http:\/\/mattgemmell.com\/source\/license\/\">license<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UPDATE: I have released an updated version of this sample that takes advantage of improvements Apple made in Leopard (Mac OS X 10.5). Download SourceListView&#8230;<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"http:\/\/markalldritt.com\/?p=29\">Continue Reading<span class=\"screen-reader-text\">SourceListView<\/span><\/a><\/div><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[8],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7AQk-t","_links":{"self":[{"href":"http:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/posts\/29"}],"collection":[{"href":"http:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/markalldritt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29"}],"version-history":[{"count":2,"href":"http:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions"}],"predecessor-version":[{"id":369,"href":"http:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions\/369"}],"wp:attachment":[{"href":"http:\/\/markalldritt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/markalldritt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/markalldritt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}