title: Drawing text in a NSButton subclass - positioning
body: <p>I Have a custom button:
  <a href="http://cld.ly/29ubq" rel="nofollow noreferrer">My Button http://cld.ly/29ubq</a></p>
  
  <p>And I need the text to be centered, here's my code:</p>
  
  <pre><code>NSMutableParagraphStyle *style =
      [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
  [style setLineBreakMode:NSLineBreakByWordWrapping];
  [style setAlignment:NSLeftTextAlignment];
  att = [[NSDictionary alloc] initWithObjectsAndKeys:
             style, NSParagraphStyleAttributeName, 
             [NSColor blackColor],
             NSForegroundColorAttributeName, nil];
  [style release];
  // other Drawing code here
  [[self title] drawInRect:[self bounds] withAttributes:att];
  </code></pre>
  
  <p>How do I center the text in the center of my button (not center of the bounds)?</p>