You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Luiz Gustavo <lu...@gmail.com> on 2010/12/02 02:56:07 UTC

windowClosing event

Hi,

what would be, in Pivot, the equivalent  event of
WindowListener.windowClosing in Swing?
I'd like to show a message to the user, when he leaves the application.

-- 
Luiz Gustavo S. de Souza

http://luizgustavoss.wordpress.com
http://luizgustavoss.blogspot.com
http://twitter.com/lugustso

Re: windowClosing event

Posted by Greg Brown <gk...@verizon.net>.
Sorry, I forgot that you are using 1.5.2 - that example is for 2.0 (so getSelectedOption() actually no longer exists). Glad that you got it working, though.

G

On Dec 1, 2010, at 10:43 PM, Luiz Gustavo wrote:

> Hi Greg,
> 
> it worked perfectly! thanks.
> Just a note: alert.getSelectedOptionInex() doesn't exist anymore. I had to use alert.getSelectedOption().
> 
> Luiz
> 
> 2010/12/2 Greg Brown <gk...@verizon.net>
> No, just override shutdown() and return true until the user accepts the prompt. See this example:
> 
> http://svn.apache.org/repos/asf/pivot/trunk/tests/src/org/apache/pivot/tests/ShutdownTest.java
> 
> 
> On Dec 1, 2010, at 10:06 PM, Luiz Gustavo wrote:
> 
>> Hi Greg,
>> 
>> I'd like to just show a Prompt to the user, as he tries to close the application, and as soon as he confirms, the applications exits normally.
>> WindowStateListener#previewWindowClose() doesn't really help me in that.
>> I could try Application#shutdown(), because de application is runing in a desktop. Where would you put that? In the
>> WindowStateListener#previewWindowClose()? 
>> 
>> Luiz
>> 
>> 
>> 2010/12/2 Greg Brown <gk...@verizon.net>
>> You could implement WindowStateListener#previewWindowClose(), but that may not be what you are looking for. I'd try using Application#shutdown(). You can return true from this method if you want to cancel shutdown (though this currently only works when you are running in DesktopApplicationContext, not a browser).
>> G
>> 
>> 
>> On Dec 1, 2010, at 8:56 PM, Luiz Gustavo wrote:
>> 
>>> Hi,
>>> 
>>> what would be, in Pivot, the equivalent  event of WindowListener.windowClosing in Swing?
>>> I'd like to show a message to the user, when he leaves the application.
>>> 
>>> -- 
>>> Luiz Gustavo S. de Souza
>>> 
>>> http://luizgustavoss.wordpress.com
>>> http://luizgustavoss.blogspot.com
>>> http://twitter.com/lugustso
>> 
>> 
>> 
>> 
>> -- 
>> Luiz Gustavo S. de Souza
>> 
>> http://luizgustavoss.wordpress.com
>> http://luizgustavoss.blogspot.com
>> http://twitter.com/lugustso
> 
> 
> 
> 
> -- 
> Luiz Gustavo S. de Souza
> 
> http://luizgustavoss.wordpress.com
> http://luizgustavoss.blogspot.com
> http://twitter.com/lugustso


Re: windowClosing event

Posted by Luiz Gustavo <lu...@gmail.com>.
Hi Greg,

it worked perfectly! thanks.
Just a note: alert.getSelectedOptionInex() doesn't exist anymore. I had to
use alert.getSelectedOption().

Luiz

2010/12/2 Greg Brown <gk...@verizon.net>

> No, just override shutdown() and return true until the user accepts the
> prompt. See this example:
>
>
> http://svn.apache.org/repos/asf/pivot/trunk/tests/src/org/apache/pivot/tests/ShutdownTest.java
>
>
> On Dec 1, 2010, at 10:06 PM, Luiz Gustavo wrote:
>
> Hi Greg,
>
> I'd like to just show a Prompt to the user, as he tries to close the
> application, and as soon as he confirms, the applications exits normally.
> WindowStateListener#previewWindowClose() doesn't really help me in that.
> I could try Application#shutdown(), because de application is runing in a
> desktop. Where would you put that? In the
> WindowStateListener#previewWindowClose()?
>
> Luiz
>
>
> 2010/12/2 Greg Brown <gk...@verizon.net>
>
>> You could implement WindowStateListener#previewWindowClose(), but that may
>> not be what you are looking for. I'd try using Application#shutdown(). You
>> can return true from this method if you want to cancel shutdown (though this
>> currently only works when you are running in DesktopApplicationContext, not
>> a browser).
>> G
>>
>>
>> On Dec 1, 2010, at 8:56 PM, Luiz Gustavo wrote:
>>
>> Hi,
>>
>> what would be, in Pivot, the equivalent  event of
>> WindowListener.windowClosing in Swing?
>> I'd like to show a message to the user, when he leaves the application.
>>
>> --
>> Luiz Gustavo S. de Souza
>>
>> http://luizgustavoss.wordpress.com
>> http://luizgustavoss.blogspot.com
>> http://twitter.com/lugustso
>>
>>
>>
>
>
> --
> Luiz Gustavo S. de Souza
>
> http://luizgustavoss.wordpress.com
> http://luizgustavoss.blogspot.com
> http://twitter.com/lugustso
>
>
>


-- 
Luiz Gustavo S. de Souza

http://luizgustavoss.wordpress.com
http://luizgustavoss.blogspot.com
http://twitter.com/lugustso

Re: windowClosing event

Posted by Greg Brown <gk...@verizon.net>.
No, just override shutdown() and return true until the user accepts the prompt. See this example:

http://svn.apache.org/repos/asf/pivot/trunk/tests/src/org/apache/pivot/tests/ShutdownTest.java

On Dec 1, 2010, at 10:06 PM, Luiz Gustavo wrote:

> Hi Greg,
> 
> I'd like to just show a Prompt to the user, as he tries to close the application, and as soon as he confirms, the applications exits normally.
> WindowStateListener#previewWindowClose() doesn't really help me in that.
> I could try Application#shutdown(), because de application is runing in a desktop. Where would you put that? In the
> WindowStateListener#previewWindowClose()? 
> 
> Luiz
> 
> 
> 2010/12/2 Greg Brown <gk...@verizon.net>
> You could implement WindowStateListener#previewWindowClose(), but that may not be what you are looking for. I'd try using Application#shutdown(). You can return true from this method if you want to cancel shutdown (though this currently only works when you are running in DesktopApplicationContext, not a browser).
> G
> 
> 
> On Dec 1, 2010, at 8:56 PM, Luiz Gustavo wrote:
> 
>> Hi,
>> 
>> what would be, in Pivot, the equivalent  event of WindowListener.windowClosing in Swing?
>> I'd like to show a message to the user, when he leaves the application.
>> 
>> -- 
>> Luiz Gustavo S. de Souza
>> 
>> http://luizgustavoss.wordpress.com
>> http://luizgustavoss.blogspot.com
>> http://twitter.com/lugustso
> 
> 
> 
> 
> -- 
> Luiz Gustavo S. de Souza
> 
> http://luizgustavoss.wordpress.com
> http://luizgustavoss.blogspot.com
> http://twitter.com/lugustso


Re: windowClosing event

Posted by Luiz Gustavo <lu...@gmail.com>.
Hi Greg,

I'd like to just show a Prompt to the user, as he tries to close the
application, and as soon as he confirms, the applications exits normally.
WindowStateListener#previewWindowClose() doesn't really help me in that.
I could try Application#shutdown(), because de application is runing in a
desktop. Where would you put that? In the
WindowStateListener#previewWindowClose()?

Luiz


2010/12/2 Greg Brown <gk...@verizon.net>

> You could implement WindowStateListener#previewWindowClose(), but that may
> not be what you are looking for. I'd try using Application#shutdown(). You
> can return true from this method if you want to cancel shutdown (though this
> currently only works when you are running in DesktopApplicationContext, not
> a browser).
> G
>
>
> On Dec 1, 2010, at 8:56 PM, Luiz Gustavo wrote:
>
> Hi,
>
> what would be, in Pivot, the equivalent  event of
> WindowListener.windowClosing in Swing?
> I'd like to show a message to the user, when he leaves the application.
>
> --
> Luiz Gustavo S. de Souza
>
> http://luizgustavoss.wordpress.com
> http://luizgustavoss.blogspot.com
> http://twitter.com/lugustso
>
>
>


-- 
Luiz Gustavo S. de Souza

http://luizgustavoss.wordpress.com
http://luizgustavoss.blogspot.com
http://twitter.com/lugustso

Re: windowClosing event

Posted by Greg Brown <gk...@verizon.net>.
You could implement WindowStateListener#previewWindowClose(), but that may not be what you are looking for. I'd try using Application#shutdown(). You can return true from this method if you want to cancel shutdown (though this currently only works when you are running in DesktopApplicationContext, not a browser).
G

On Dec 1, 2010, at 8:56 PM, Luiz Gustavo wrote:

> Hi,
> 
> what would be, in Pivot, the equivalent  event of WindowListener.windowClosing in Swing?
> I'd like to show a message to the user, when he leaves the application.
> 
> -- 
> Luiz Gustavo S. de Souza
> 
> http://luizgustavoss.wordpress.com
> http://luizgustavoss.blogspot.com
> http://twitter.com/lugustso