Thanks! Got it running in a few minutes. For others, I used the 
NSTableViewDelegate methods

tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:

and

tableView:shouldShowCellExpansionForTableColumn:row:

to prevent the cell expansion.
------------
Don Hall
Apps & More Software Design, Inc.       
d...@appsandmore.com


On 2012-05-02, at 11:54 AM, cocoa-dev-requ...@lists.apple.com wrote:

> From: Corbin Dunn <corb...@apple.com>
> To: Donald Hall <d...@appsandmore.com>
> Cc: cocoa-dev@lists.apple.com
> Subject: Re: NSTableview tooltip bug?
> Message-ID: <0a0b2cde-d218-4d90-8021-c73872afd...@apple.com>
> Content-Type: text/plain; charset=us-ascii
> 
> hi don,
> I recommend using the builtin tooltip support in NSTableView. There is a 
> delegate method to provide the tool tip. Next, you are seeing 
> expansionToolTips. Look at NSCell.h for custom drawing API for them. Or, turn 
> them off for your table with API on NSTableView.
> 
> corbin
> 
> On May 1, 2012, at 5:10 PM, Donald Hall <d...@appsandmore.com> wrote:
> 
>> I have an NSTableview column where each cell contains a file name. I use 
>> tooltips (addToolTipRect and NSToolTipOwner protocol)  to show the complete 
>> path to the file when the user hovers the mouse over the cell. This works 
>> fine unless the name of the file exceeds the column width - 3 pixels. i.e. 
>> if the width of the text for the cell is greater than (column width - 3) I 
>> get a strange behaviour: the correct tooltip flashes briefly in the usual 
>> place relative to the cell, then the cell itself becomes highlighted with a 
>> bright yellow background. If the text width is greater than the cell width 
>> the the highlighted rectangle extends over the column boundary, so I guess 
>> it is the enclosing rectangle of the cell's text that is highlighted.
>> 
>> I created a category on NSString to define a truncated string method where I 
>> remove characters from the middle of the string to fit it into a specified 
>> width. My workaround to this problem was to specify the column width - 3 as 
>> the width I wanted for the truncated string.
>> 
>> Has anyone else seen this? Is it a known bug?
>> 
>> Thanks, Don
>> 
>> ------------
>> Don Hall
>> Apps & More Software Design, Inc.    
>> d...@appsandmore.com
>> 
> 

_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to