title: Calculating width of checkboxes in NSOutlineView
body: <p>I'm programmatically setting up a multi-column <code>NSOutlineView</code>. The first column contains only checkboxes whereas the other columns contain text. I'm creating the checkboxes like this:</p>
  
  <pre><code>cell = [[NSButtonCell alloc] init];
  [cell setButtonType:NSSwitchButton];
  [cell setImagePosition:NSImageOnly];
  </code></pre>
  
  <p>Now I want to adjust the width of the first <code>NSTableColumn</code> to the exact width required by a checkbox. To calculate the dimensions of a checkbox cell, I do the following:</p>
  
  <pre><code>NSCell *cell = [m_view preparedCellAtColumn:0 row:0];
  unsigned cellWidth = [cell cellSize].width;
  </code></pre>
  
  <p>This returns <code>18</code> in <code>cellWidth</code>. This is probably the right value but it isn't sufficient because <code>NSOutlineView</code> always seems to insert some blank space before the cells of the very first column. Here's what it looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/fPBAo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fPBAo.png" alt="enter image description here"></a>  </p>
  
  <p>As you can see the checkboxes are currently cut off because the column width is too small because of the blank space in front of the checkbox.</p>
  
  <p>Therefore, here is my question: How can I calculate the width of this blank space for my first <code>NSTableColumn</code> so that I can calculate the full column width required to show the checkbox and blank space? Is there maybe also a way to get rid of this blank space? </p>