1

Currently I have a XUL notification box being displayed as I am developing a Firefox Addon. At the moment the notification box will only display at the bottom of the browser and cannot find any information about changing the position to the top of the browser. I know you can use priority_high etc... but it only seems to add this again at the bottom of the browser.

Code:

<notificationbox flex="0.1">
<browser src="http://www.mozilla.org"/> 
<notification type="warning" label="Test"/> 
</notificationbox>

Any help will be grateful.

  • You can use 'attributes':https://developer.mozilla.org/en-US/docs/XUL/notificationbox – linguini Feb 11 '13 at 09:11
  • You can try door hanger pop-up:http://stackoverflow.com/questions/7816749/creating-this-kind-of-popup-in-firefox-addons – linguini Feb 11 '13 at 09:12
  • I have used the position attribute but it only allows for the box to be right at the top so that the browser buttons to close the browser are no longer accessible. –  Feb 11 '13 at 18:27
  • I see just 2 types, Top & left:https://developer.mozilla.org/en-US/docs/XUL/PopupGuide/Positioning – linguini Feb 11 '13 at 19:08
  • This does not seem to move the positioning of the notification box. Ive tried both top and left and neither have adjusted the box. –  Feb 11 '13 at 19:32
  • Try to use Overlay then append Notificationbox(if not it'll go for a default behavior) Or Use your own Notification box like a dialog or Own alert & overlay it. see here:http://code.google.com/p/ff-html5notifications/source/browse/src/content/alert/alertOverlay.xul?spec=svn3c720f6b618015986235d796905373db850b2536&r=3c720f6b618015986235d796905373db850b2536 – linguini Feb 11 '13 at 19:51

1 Answers1

0

I have tested with XUL Explorer, I could change the positions successfully. Here is the code:

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

    <!-- your code here -->
<stack>
<hbox flex="1" left="100" right="10" top="50" bottom="10"> 
<notificationbox flex="0.1" >
<browser src="http://www.mozilla.org"/>
<notification type="warning" label="Test" />
</notificationbox>
</hbox> 
</stack>
</window>

enter image description here

linguini
  • 1,939
  • 5
  • 49
  • 79
  • Thank you for the code above. Issue now is the hbox is displaying at the bottom of the web browser. Not sure if there is just a simple position attribute to add. –  Feb 11 '13 at 20:47
  • Play with this : `left="100" right="10" top="50" bottom="10"`Change these values. – linguini Feb 11 '13 at 21:00
  • I have but it just changes the size of hbox. –  Feb 11 '13 at 21:09
  • For instance im using ' ' –  Feb 11 '13 at 21:10
  • No big issue though as now I can finally position the notification box as wished. Only issue is positioning the label within the notification box i have tried align="center" which does not position the label. –  Feb 11 '13 at 21:32
  • 1
    May be you can create the label dynamically & position it. – linguini Feb 11 '13 at 21:34
  • I shall try that. Thanks for your help! –  Feb 11 '13 at 21:38
  • 1
    As per XUL doc, right, left & center are `deprecated` : https://developer.mozilla.org/en-US/docs/XUL/Attribute/align – linguini Feb 11 '13 at 21:47