Sam,

Pivot has WindowStateListeners which can be used to execute code when a
Window opens, closes, is requested for closure and if the close request is
vetoed..
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/WindowStateListener.html

Frame, Dialog, Alert, Prompt & Sheet (among others) extend Window, so you
can use a WindowStateListener to trigger the execution of code when a Window
is opened.

This page has a diagram showing other Window subclasses that therefore all
support  WindowStateListeners
http://pivot.apache.org/tutorials/platform-overview.html

Note that Window subclasses can also have their own, more specific listeners
which cover similar functionality.  For instance Sheet has the following
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/SheetCloseListener.html
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/SheetStateListener.html

Chris

On 20 April 2011 09:44, sam <[email protected]> wrote:

> Hi, In swing the Dialog shows up and the code after dialog.setVisible(true)
> will not run until the dialog is closed. The Alert or prompt in Pivot is not
> following that behavior. I tested the following code as a button listener.
> The alert shows up on screen right but the System.out.printlnn() prints
> before the alert was closed. Is this simply because pivot wasn't design the
> same way swing dialog was designed or I missed something?
>
> function buttonPressed(button) {
>      Alert.alert("This is an Alert.", frame);
>     System.out.println("alert showd");
>  }
>
> Sam
> ------------------------------
> View this message in context: Alert opened and the rest of code keep 
> going<http://apache-pivot-users.399431.n3.nabble.com/Alert-opened-and-the-rest-of-code-keep-going-tp2841188p2841188.html>
> Sent from the Apache Pivot - Users mailing list 
> archive<http://apache-pivot-users.399431.n3.nabble.com/>at Nabble.com.
>

Reply via email to