added checking - can only show modal dialog in event listener

This commit is contained in:
Heng Sin Low 2009-05-20 03:42:46 +00:00
parent ab7f59032b
commit 6d33a6c7e3
1 changed files with 4 additions and 1 deletions

View File

@ -230,7 +230,10 @@ public class Messagebox extends Window implements EventListener
this.setWidth("500px"); this.setWidth("500px");
this.setPosition("center"); this.setPosition("center");
this.setClosable(true); this.setClosable(true);
if (Events.inEventListener())
this.setAttribute(Window.MODE_KEY, Window.MODE_MODAL); this.setAttribute(Window.MODE_KEY, Window.MODE_MODAL);
else
this.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
this.setSizable(true); this.setSizable(true);
this.setVisible(true); this.setVisible(true);