Avoid showing bogus tooltips in macOS wxDataViewCtrl

Cells using custom renderers showed useless tooltips with the debug
representation of wxCustomRendererObject, which were worse than useless,
so avoid showing them.

Contrary to what might be expected, this can't be done by overriding the
specific tooltip-related delegate method, because these tooltips come
from NSTextFieldCell itself, so we need to prevent it from showing them.

Closes #24370.
This commit is contained in:
Vadim Zeitlin 2024-03-03 01:24:22 +01:00
parent 2464c900f5
commit df6adcbedd

View file

@ -1111,6 +1111,20 @@ outlineView:(NSOutlineView*)outlineView
return cellFrame; return cellFrame;
} }
-(NSRect)expansionFrameWithFrame:(NSRect)cellFrame
inView:(NSView*)view
{
// We override the default behaviour to avoid showing nonsensical tooltips
// for the custom cells: if we don't do this, NSTextFieldCell would show a
// tooltip with the debug representation of wxCustomRendererObject which is
// not very useful.
//
// Note: override outlineView:toolTipForCell:rect:tableColumn:item:mouseLocation:
// in NSOutlineViewDelegate if we ever want to support per-cell tooltips
// instead of just suppressing them.
return NSZeroRect;
}
@end @end
// ============================================================================ // ============================================================================