I have been reading various blogs, tried to search CocoaBuilder, and have ben looking at the code in Apple's PhotoSearch sample, but am not clear about the best way to handle this situation:

I have an NSOutlineView for which I have set a custom cell (sub class of NSTextViewCell) in order to draw a badge on the right side of the cell.

I have overridden drawInteriorWithFrame:controlView: to do my drawing there. It seems to me that when a row that has descendent nodes is expanded, the width of the hierarchically containing cells (lower level value) are made wider (by the same amount as the indentation). Both the indented cells (by their indentation) and the higher order cells (by the increased cell width) now have their right side pushed partway out of the viewable area of the column. So, I can't determine the x position of the badge based upon the width of the cell (a hierarchically outer cell with no indent has an increased width, yet to calculate a proper x coordinate, the cell would need to know that some other table items are expanded; how could it "know" this?)

My best idea so far is to determine the position based on the table column's width, and take into account the indent level. But I suspect there are any of a number of ways to handle this, and so am looking for guidance on a best practice from those with experience.
TIA.



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to