title = @"< ? >"; /* (get out in the open so we know about it) */
keyEq = [self parseKeyEquiv: wv->key];
+#ifdef NS_IMPL_COCOA
+ /* OS X just ignores modifier strings longer than one character */
if (keyEquivModMask == 0)
title = [title stringByAppendingFormat: @" (%@)", keyEq];
+#endif
item = [self addItemWithTitle: (NSString *)title
action: @selector (menuDown:)
{
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];
}
item = XCAR (list);
if (XTYPE (item) == Lisp_String)
{
- [window addString: XSTRING (item)->data row: row++];
+ [window addString: SDATA (item) row: row++];
}
else if (XTYPE (item) == Lisp_Cons)
{
- [window addButton: XSTRING (XCAR (item))->data
+ [window addButton: SDATA (XCAR (item))
value: XCDR (item) row: row++];
}
else if (NILP (item))
if (XTYPE (head) == Lisp_String)
[title setStringValue:
- [NSString stringWithUTF8String: XSTRING (head)->data]];
+ [NSString stringWithUTF8String: SDATA (head)]];
else if (isQ == YES)
[title setStringValue: @"Question"];
else