GNU bug report logs - #2747
[PATCH] 23.0.91; multi-line tooltips don't work on nextstep

Previous Next

Packages: emacs, ns;

Reported by: Nikolaj Schumacher <me <at> nschum.de>

Date: Sun, 22 Mar 2009 17:55:05 UTC

Severity: normal

Merged with 2278

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 2747 in the body.
You can then email your comments to 2747 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2747; Package emacs. (Sun, 22 Mar 2009 17:55:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nikolaj Schumacher <me <at> nschum.de>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 22 Mar 2009 17:55:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

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




bug reassigned from package `emacs' to `emacs,ns'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Sun, 22 Mar 2009 19:55:05 GMT) Full text and rfc822 format available.

Merged 2278 2747. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Sun, 22 Mar 2009 19:55:05 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com:
bug#2747; Package emacs,ns. (Mon, 23 Mar 2009 02:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com. (Mon, 23 Mar 2009 02:00:02 GMT) Full text and rfc822 format available.

Message #14 received at 2747 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Nikolaj Schumacher <me <at> nschum.de>, 2747 <at> debbugs.gnu.org
Subject: Re: bug#2747: [PATCH] 23.0.91;	multi-line tooltips don't work on nextstep
Date: Mon, 23 Mar 2009 10:50:48 +0900
>>>>> On Sun, 22 Mar 2009 18:46:51 +0100, Nikolaj Schumacher <me <at> nschum.de> said:

> 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:

It might solve this particular problem, but I think the whole tooltip
code should be rewritten so as to use an Emacs frame like in the other
platforms.
(cf. http://lists.gnu.org/archive/html/emacs-devel/2009-03/msg00123.html)

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp




bug archived. Request was from Debbugs Internal Request <bug-gnu-emacs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 03 Feb 2010 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 91 days ago.

Previous Next


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