GNU bug report logs - #2278
23.0.60; Tooltips truncated on OS X

Previous Next

Packages: ns, emacs;

Reported by: Nick Roberts <nickrob <at> snap.net.nz>

Date: Wed, 11 Feb 2009 10:40:03 UTC

Severity: normal

Merged with 2747

Done: David Reitter <david.reitter <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: bug-gnu-emacs <at> gnu.org (Emacs bug Tracking System)
To: Nikolaj Schumacher <me <at> nschum.de>
Subject: bug#2747 closed by David Reitter <david.reitter <at> gmail.com> (done)
Date: Mon, 04 Jan 2010 06:26:01 +0000
[Message part 1 (text/plain, inline)]
This is an automatic notification regarding your bug report
which was filed against the emacs,ns package:

#2278: [PATCH] 23.0.91; multi-line tooltips don't work on nextstep

It has been closed by David Reitter <david.reitter <at> gmail.com>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact David Reitter <david.reitter <at> gmail.com> by
replying to this email.


-- 
2278: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2278
Emacs Bug Tracking System
Contact bug-gnu-emacs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: David Reitter <david.reitter <at> gmail.com>
To: 2278-done <at> debbugs.gnu.org
Subject: done
Date: Mon, 4 Jan 2010 07:25:24 +0100
patch was checked in 2009-06-14.

[Message part 3 (message/rfc822, inline)]
From: Nikolaj Schumacher <me <at> nschum.de>
To: emacs-pretest-bug <at> gnu.org
Subject: [PATCH] 23.0.91; multi-line tooltips don't work on nextstep
Date: Sun, 22 Mar 2009 18:46:51 +0100
In GNU Emacs 23.0.91.1 (i386-apple-darwin9.6.0, NS apple-appkit-949.43)
 of 2009-03-22 on thursday
Windowing system distributor `Apple', version 10.3.949
configured using `configure  '--with-ns' '--with-x''


Only the first line multi-line tooltips like

  (tooltip-show "foo\nbar")

appear on nextstep.


The following patch seems to be a simple (perhaps too simple?) solution:


diff --git a/src/nsmenu.m b/src/nsmenu.m
index 9a97492..97d29e9 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -1398,10 +1398,7 @@ update_frame_tool_bar (FRAME_PTR f)
   NSColor *col = [NSColor colorWithCalibratedRed: 1.0 green: 1.0
                                             blue: 0.792 alpha: 0.95];
   NSFont *font = [NSFont toolTipsFontOfSize: 0];
-  NSFont *sfont = [font screenFont];
-  int height = [sfont ascender] - [sfont descender];
-/*[font boundingRectForFont].size.height; */
-  NSRect r = NSMakeRect (0, 0, 100, height+6);
+  NSRect r = NSMakeRect (0, 0, 100, 100);
 
   textField = [[NSTextField alloc] initWithFrame: r];
   [textField setFont: font];
@@ -1438,10 +1435,8 @@ update_frame_tool_bar (FRAME_PTR f)
 - (void) setText: (char *)text
 {
   NSString *str = [NSString stringWithUTF8String: text];
-  NSRect r = [textField frame];
-  r.size.width = [[[textField font] screenFont] widthOfString: str] + 8;
-  [textField setFrame: r];
   [textField setStringValue: str];
+  [textField sizeToFit];
 }
 
 - (void) showAtX: (int)x Y: (int)y for: (int)seconds



This bug report was last modified 15 years and 143 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.