From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#2747: [PATCH] 23.0.91; multi-line tooltips don't work on nextstep Date: Sun, 22 Mar 2009 18:46:51 +0100 Message-ID: Reply-To: Nikolaj Schumacher , 2747@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1237745085 2028 80.91.229.12 (22 Mar 2009 18:04:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Mar 2009 18:04:45 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 22 19:06:02 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LlS2z-0008NR-IA for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Mar 2009 19:05:43 +0100 Original-Received: from localhost ([127.0.0.1]:47295 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LlS1c-0005GP-Tr for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Mar 2009 14:03:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LlS1Z-0005G9-55 for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2009 14:03:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LlS1U-0005Fo-L0 for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2009 14:03:52 -0400 Original-Received: from [199.232.76.173] (port=35840 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LlS1U-0005Fk-Ga for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2009 14:03:48 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:49497) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LlS1T-0006vf-UB for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2009 14:03:48 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2MI3iJf030553; Sun, 22 Mar 2009 11:03:44 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n2MHt5Fr028200; Sun, 22 Mar 2009 10:55:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Nikolaj Schumacher Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 22 Mar 2009 17:55:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 2747 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123774402026614 (code B ref -1); Sun, 22 Mar 2009 17:55:05 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 22 Mar 2009 17:47:00 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2MHkvJf026608 for ; Sun, 22 Mar 2009 10:46:58 -0700 Original-Received: from mx10.gnu.org ([199.232.76.166]:57582) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LlRlA-00014T-CA for emacs-pretest-bug@gnu.org; Sun, 22 Mar 2009 13:46:56 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LlRl8-0004s6-8z for emacs-pretest-bug@gnu.org; Sun, 22 Mar 2009 13:46:56 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:49931) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LlRl7-0004rq-MS for emacs-pretest-bug@gnu.org; Sun, 22 Mar 2009 13:46:53 -0400 Original-Received: from thursday (unknown [78.52.32.58]) by dd18200.kasserver.com (Postfix) with ESMTP id B74C7182E2EB1 for ; Sun, 22 Mar 2009 18:46:55 +0100 (CET) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (darwin) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 22 Mar 2009 14:03:52 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:26553 gmane.emacs.pretest.bugs:24165 Archived-At: 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