Permalink
Browse files

Added tooltip support

  • Loading branch information...
1 parent a1e3fed commit 55fa6024dbade24c5263ded5aa61d471c22b825a M ESCO committed with Ross Boucher Feb 7, 2009
Showing with 26 additions and 0 deletions.
  1. +26 −0 AppKit/CPControl.j
View
26 AppKit/CPControl.j
@@ -100,6 +100,8 @@ var CPControlBlackColor = [CPColor blackColor];
CPCellImagePosition _imagePosition;
CPImageScaling _imageScaling;
+ CPString _toolTip;
+
// Target-Action Support
id _target;
SEL _action;
@@ -315,6 +317,30 @@ var CPControlBlackColor = [CPColor blackColor];
}
/*!
+ 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
*/
- (SEL)action

0 comments on commit 55fa602

Please sign in to comment.