great thank you very much corbin!




________________________________
From: Corbin Dunn <corb...@apple.com>
To: Rick C. <jo_p...@yahoo.com>
Cc: Graham Cox <graham....@bigpond.com>; cocoa dev <cocoa-dev@lists.apple.com>
Sent: Tuesday, August 18, 2009 10:05:19 PM
Subject: Re: disabling tooltips table view


On Aug 18, 2009, at 5:39 AM, Rick C. wrote:

> thank you graham,
> 
> upon closer look i was in error to use the word tooltip.  i have seen this 
> method before and tried it again and it does work to change the tooltip or 
> disable it.  what i'm seeing must be some form of highlighting.  although i 
> have disabled the standard highlighting where when you click the rows it 
> highlights.  this is not my issue.  it seems the rows that are truncated with 
> a tail are the ones that highlight when i hover my mouse over the row.  on a 
> row that is not truncated it does not highlight.  i have coded into my custom 
> cell setLineBreakMode:NSLineBreakByTruncatingTail.  Maybe the issue lies 
> somewhere here?
> 
> edited:  I just discovered this method:
> 
> - (NSRect)expansionFrameWithFrame:(NSRect)cellFrame inView:(NSView *)view
> 
> and returned NSZeroRect and seems that does the job.  Assuming it does thank 
> you for your help you did get me on the right track!

What you are seeing is called an "expansion tool tip". (they aren't 
highlighting -- that is confusing term to use for them).

It is documented in our release notes:

http://developer.apple.com/releasenotes/Cocoa/AppKit.html

NSCell Automatic Expansion ToolTip Frame

> NSCell has some new API to support expansion tool tips in certain controls:
> - (NSRect)expansionFrameWithFrame:(NSRect)cellFrame inView:(NSView *)view;
> - (void)drawWithExpansionFrame:(NSRect)cellFrame inView:(NSView *)view;
> An expansion tool tip allows one to see truncated text in a special floating 
> window that is similar but different from a normal ToolTip. Currently, 
> NSTableView, NSOutlineView and NSBrowser display expansion tool tips when the 
> text is truncated. If you have a cell that will be displayed in one of these 
> controls, it is recommended that you implement the above methods to properly 
> support the expansion tool tip feature. By default, the methods are properly 
> implemented in NSTextFieldCell and NSBrowserCell. NSCell will always return 
> NSZeroRect, and prevent the expansion from happening. For an example of how 
> to implement it, see the SimpleBrowser demo app.
> 
> Clients of NSTableView, NSOutlineView and NSBrowser can prevent the cell 
> expansion from happening on a particular row/column by using the new delegate 
> methods declared in the appropriate header files.
> 
> 

Your work around is one way to turn them off; however, it is much easier to use 
this method:
> 
> /* Optional - Expansion ToolTip support
>     Implement this method and return NO to prevent an expansion tooltip from 
> appearing for a particular cell in a given row and tableColumn. See NSCell.h 
> for more information on expansion tool tips.
> */
> - (BOOL)tableView:(NSTableView *)tableView 
> shouldShowCellExpansionForTableColumn:(NSTableColumn *)tableColumn 
> row:(NSInteger)row AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
> 

corbin



      
_______________________________________________

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