+2009-06-14 Sidney Markowitz <sidney@sidney.com>
+
+ * nsmenu.m (EmacsTooltip: setText): set height of tooltip.
+
2009-06-14 Adrian Robert <Adrian.B.Robert@gmail.com>
* nsfont.m (ns_attribute_value): Remove.
{
NSString *str = [NSString stringWithUTF8String: text];
NSRect r = [textField frame];
- r.size.width = [[[textField font] screenFont] widthOfString: str] + 8;
+ NSSize textSize = [str sizeWithAttributes:
+ [NSDictionary dictionaryWithObject: [[textField font] screenFont]
+ forKey: NSFontAttributeName]];
+ NSSize padSize = [[[textField font] screenFont]
+ boundingRectForFont].size;
+
+ r.size.width = textSize.width + padSize.width/2;
+ r.size.height = textSize.height + padSize.height/2;
[textField setFrame: r];
[textField setStringValue: str];
}