From: Nikolaj Schumacher <me@nschum.de>
To: emacs-pretest-bug@gnu.org
Subject: bug#2747: [PATCH] 23.0.91; multi-line tooltips don't work on nextstep
Date: Sun, 22 Mar 2009 18:46:51 +0100 [thread overview]
Message-ID: <m2mybdpi0k.fsf@nschum.de> (raw)
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
next prev reply other threads:[~2009-03-22 17:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <A51A6A3E-37F9-4417-A5E9-E7AF2135D1BA@gmail.com>
2009-02-11 10:06 ` bug#2278: 23.0.60; Tooltips truncated on OS X Nick Roberts
2010-01-04 6:26 ` bug#2278: marked as done (23.0.60; Tooltips truncated on OS X) Emacs bug Tracking System
2009-03-22 17:46 ` Nikolaj Schumacher [this message]
2009-03-23 1:50 ` bug#2747: [PATCH] 23.0.91; multi-line tooltips don't work on nextstep YAMAMOTO Mitsuharu
2010-01-04 6:26 ` bug#2747: marked as done ([PATCH] 23.0.91; multi-line tooltips don't work on nextstep) Emacs bug Tracking System
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2mybdpi0k.fsf@nschum.de \
--to=me@nschum.de \
--cc=2747@emacsbugs.donarmstrong.com \
--cc=emacs-pretest-bug@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.