I'm trying to create a simple folder browser showing the tree structure using NSOutlineView. Using monoMac and Xamarin Studio with XCode interface builder for the UI.
The problem I have right now is how to have the column resize to the width of the content and / or how to trim the text shown in the column.
The first setting I tried is enabling AutoresizesOutlineColumn. This does resize the column to some degree, but once it encounters a name with hyphens it only resizes to the first hyphen, and from there it seems like it doesn't resize any further.
Next I tried to enable set the column to resize to "AutoResize with table" and the cell to "truncate head", but this too does not work as I expected.
What I want is the column to always be full width of context and then have the view show a horizontal scrollbar. Any pointers how to configure this ?. I have searched online, but the examples I have found is mostly on how to use the data source, nothing on how to configure the view itself.
The 2 screenshot shows the issue, as you can see, when resized the node name is clipped not truncated and no scrollbar is shown


Each outline view shown in your image is actually enclosed in their own scroll view (
NSScrollView). To get a horizontal scroll bar, you’ll need to change the properties of the scroll view, not of the outline view itself.Sorry, I can’t give you the exact code and syntax, as I’m not familiar with monomac, but in Objective-C the code would look like the following:
Basically, you ask the outline view for its enclosing scroll view, then you set the scroll view to have a horizontal scroll bar.
If you’re using Xcode’s Interface Builder to create nib files, and have the outline views present in the nib file, you should be able to set the “Show Horizontal Scroller” property to prevent having to do it programmatically at runtime.