I'm working on a mail notifier. Here is part of code:
alertsService=Components.classes["@mozilla.org/alertsservice;1"].getService(Components.interfaces.nsIAlertsService),
alertsService.showAlertNotification("chrome://mailnotifier/skin/sample-small.jpg", info,mail_title, false, "", null, "");
The problem is "showAlertNotification" and ba开发者_如何学JAVAsed on description in MDC :
text
The text to display in the alert, explaining the alert condition. The text must not be too long, otherwise it might be truncated to a platform-specific length. If the text is too long, try to use line returns in the text to have it split and displayed over multiple lines.*
I tried br,br/,"\n","\r"
.etc for line return, they all failed to make the line break, Does anyone know how to solve this problem ?
The XUL sliding alert does not support multiline text. I can't speak for the platform-specific implementations available (with appropriate packages installed) on the Mac and Linux.
You could always try forking the implementation of the XUL sliding alert; Thunderbird does that for its new mail alert.
精彩评论