diff --git a/AppKit/CPControl.j b/AppKit/CPControl.j index 23fbf5b1e1..3edb5a8bbe 100644 --- a/AppKit/CPControl.j +++ b/AppKit/CPControl.j @@ -100,6 +100,8 @@ var CPControlBlackColor = [CPColor blackColor]; CPCellImagePosition _imagePosition; CPImageScaling _imageScaling; + CPString _toolTip; + // Target-Action Support id _target; SEL _action; @@ -314,6 +316,30 @@ var CPControlBlackColor = [CPColor blackColor]; return _textShadow; } +/*! + Sets the tooltip for the receiver. + @param aToolTip the tooltip +*/ +-(void)setToolTip:(CPString)aToolTip +{ + if (_toolTip == aToolTip) + return; + + _toolTip = aToolTip; + +#if PLATFORM(DOM) + _DOMElement.title = [aToolTip cssString]; +#endif +} + +/*! + Returns the receiver's tooltip +*/ +-(CPString)toolTip +{ + return _toolTip; +} + /*! Returns the receiver's target action */