<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: objc code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 04:16:15 GMT</pubDate>
    <description>DZone Snippets: objc code</description>
    <item>
      <title>How to draw your own table header... (with borders)</title>
      <link>http://snippets.dzone.com/posts/show/3931</link>
      <description>// It's a bit  hacky at the beginning, but nstableheadercell wasn't exactly making things easy for me&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;- (void)_drawThemeContents:(NSRect)cellFrame highlighted:(BOOL)highlighted inView:(NSTableHeaderView *)view;&lt;br /&gt;{&lt;br /&gt;	int index = [view columnAtPoint:NSMakePoint(cellFrame.origin.x + 1,cellFrame.origin.y + 1)];&lt;br /&gt;	NSRect headerRect;&lt;br /&gt;	if(index != -1)&lt;br /&gt;		headerRect = [view headerRectOfColumn:index];&lt;br /&gt;	else&lt;br /&gt;		headerRect = NSZeroRect;&lt;br /&gt;	&lt;br /&gt;	[headerImage drawInRect:cellFrame&lt;br /&gt;				   fromRect:NSZeroRect&lt;br /&gt;				  operation:NSCompositeSourceOver&lt;br /&gt;				   fraction:1.0];&lt;br /&gt;	&lt;br /&gt;	[[NSColor colorWithCalibratedRed:207.0/255.0&lt;br /&gt;							   green:207.0/255.0&lt;br /&gt;								blue:207.0/255.0&lt;br /&gt;							   alpha:1.0] set];&lt;br /&gt;	NSRectFill(NSMakeRect(headerRect.origin.x, headerRect.origin.y + 1, headerRect.size.width, headerRect.size.height - 2));&lt;br /&gt;	[headerImage drawInRect:NSMakeRect(headerRect.origin.x, headerRect.origin.y, headerRect.size.width - 1, headerRect.size.height)&lt;br /&gt;				   fromRect:NSZeroRect&lt;br /&gt;				  operation:NSCompositeSourceOver&lt;br /&gt;				   fraction:1.0];&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 28 Apr 2007 19:48:47 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3931</guid>
      <author>aptiva (Fj&#195;&#182;lnir &#195;?sgeirsson)</author>
    </item>
    <item>
      <title>How to make the system notify you of audio cd insertion</title>
      <link>http://snippets.dzone.com/posts/show/3856</link>
      <description>// Uses the DiskArbitration framework to notify ya of when new audio cds are inserted&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;NSDictionary *match = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"IOCDMedia", [NSNumber numberWithBool:YES], nil] forKeys:[NSArray arrayWithObjects:(NSString *)kDADiskDescriptionMediaKindKey, kDADiskDescriptionMediaWholeKey, nil]];&lt;br /&gt;		&lt;br /&gt;_session = DASessionCreate(kCFAllocatorDefault);&lt;br /&gt;DASessionScheduleWithRunLoop(_session, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);&lt;br /&gt;DARegisterDiskAppearedCallback(_session, (CFDictionaryRef)match, diskAppearedCallback, NULL);&lt;br /&gt;DARegisterDiskDisappearedCallback(_session, (CFDictionaryRef)match, diskDisappearedCallback, NULL);&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 23 Apr 2007 12:05:23 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3856</guid>
      <author>aptiva (Fj&#195;&#182;lnir &#195;?sgeirsson)</author>
    </item>
  </channel>
</rss>
