pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd Volkert <tvolk...@gmail.com>
Subject Re: Blocking while a dialog/prompt/alert/sheet is open, like Javascript's alert() ?
Date Tue, 26 Jan 2010 18:39:46 GMT
Then, you'd be calling a UI method (dialog.open()) on a worker thread, which
isn't supported.  Not to mention which the cure seems worse than the disease
in this case...

-T

On Tue, Jan 26, 2010 at 1:28 PM, Clint Gilbert <
clint_gilbert@hms.harvard.edu> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Andreas Siegrist wrote:
> > It's impossible.
> > So you should keep the gui and your model+logic in seperate threads.
>
> What's the best way to do that?  Something naive like
>
> final Semaphore lock = new Semaphore(1);
>
> new Thread(new Runnable() {
>  @Override
>  public final void run() {
>    lock.acquire();
>    dialog.open(..., new DialogCloseListener() {
>       @Override
>      public void dialogClosed(Dialog arg0, boolean arg1) {
>        lock.release();
>      }
>     });
>  }
> }).start();
>
> lock.acquire();
>
> Doesn't work.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAktfNFUACgkQ5IyIbnMUeTsVIwCgkdUTbBOXN5gx18RA8X0hTyrn
> a1MAnRuP+zwcx/b8vpw4p7n5YCfelSGW
> =AggP
> -----END PGP SIGNATURE-----
>

Mime
View raw message