bugGNUstep - Bugs: bug #13582, NSRunAlertPanel() should wrap the...


bug #13582: NSRunAlertPanel() should wrap the message string where possible

Submitter:  Peter Cooper <comrade>
Submitted:  Thu 30 Jun 2005 01:37:07 PM UTC
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

Tue 21 Apr 2009 05:30:16 PM UTC, comment #3: 

here is a tiny patch to have the dialog not any larger than half the screen (would look more decent i guess), if text is larger than that scrollbars will still be used (same as the old behavior). I think wrapping will need a rewrite of sizePanelToFit. Or maybe \n could be inserted into the user text where appropriate to fake the wrapping?

(file #17986)

Fred Morcos <fredmorcos>
Sun 13 Nov 2005 03:05:27 PM UTC, comment #2: 

I've recently found that this problem also makes it difficult to use the same strings on GNUstep and OSX.

I have some longish strings in some alert panels, which I've inserted \n's into to get reasonably wide alert panels. On OSX, these strings are wrapped automatically, so the hard returns look a little odd.

Rob Burns <rburns>
Thu 30 Jun 2005 02:50:10 PM UTC, comment #1: 

I wanted to add that I agree, it should be wrapped when possible. And also, that in cases where the string is very long the margins around the text shrink to some value very small. In the following screenshots, you can see gradually longer strings and their effects on the margin.



Rob Burns <rburns>
Thu 30 Jun 2005 01:37:07 PM UTC, original submission:  

When NSRunAlertPanel() is called, the dialog box that appears is the full width of the message string, or if the message string is too wide for the screen, then a full-width window is created with a horizontal scrollbar.

Not only does this look unappealing, but makes the message harder to understand for an end-user (we're not so good at reading long horizontal runs of text). I do not believe that the application designer should have to manually line-break the message to the user unless strictly necessary for comprehension.

When I look at the source of NSAlert.m, I see that the current behaviour is what the coder intended. I believe that this is a usability problem.

The panel should contain the wrapped text of the message and adjust its height, not width. The code that looks like it does the work is the sizePanelToFit method.

If this bug report is rejected, then I'd suggest we strongly encourage developers to use a short message and add an "explain" button to their Alert panels which displays the more complete text (a la the OpenStep UI Guidelines).

Peter Cooper <comrade>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by fredmorcos (Updated the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-04-21 fredmorcos Attached File- Added gnustep-gui-gsalertpanel-size-fix.patch, #17986

    Back to the top

    Powered by Savane 3.13-3736.
    Corresponding source code