You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Hugo Ferreira <hf...@gmail.com> on 2020/07/27 23:01:28 UTC

Close application

I can close my Desktop Flex application with this simple instruction:
NativeApplication.nativeApplication.exit()

I would like to replicate the same with Royale: In a browser context should
close the browser Tab and in a Desktop/Electron should close the window.
This is possible ?

Re: Close application

Posted by Hugo Ferreira <hf...@gmail.com>.
Unfortunately does not work on Chrome.
Seems to be a JavaScript Chrome security issue and not a Royale issue.

Harbs <ha...@gmail.com> escreveu no dia terça, 28/07/2020 à(s) 06:29:

> You should be able to do that using window.close()
>
> For Electron, I think you have a couple of options. I think you can listen
> to the close event and quit the app then. You can also quit or exit
> directly.[1]
>
> HTH,
> Harbs
>
> [1] https://www.electronjs.org/docs/api/app
>
> > On Jul 28, 2020, at 2:01 AM, Hugo Ferreira <hf...@gmail.com>
> wrote:
> >
> > I can close my Desktop Flex application with this simple instruction:
> > NativeApplication.nativeApplication.exit()
> >
> > I would like to replicate the same with Royale: In a browser context
> should
> > close the browser Tab and in a Desktop/Electron should close the window.
> > This is possible ?
>
>

Re: Close application

Posted by Harbs <ha...@gmail.com>.
You should be able to do that using window.close()

For Electron, I think you have a couple of options. I think you can listen to the close event and quit the app then. You can also quit or exit directly.[1]

HTH,
Harbs

[1] https://www.electronjs.org/docs/api/app

> On Jul 28, 2020, at 2:01 AM, Hugo Ferreira <hf...@gmail.com> wrote:
> 
> I can close my Desktop Flex application with this simple instruction:
> NativeApplication.nativeApplication.exit()
> 
> I would like to replicate the same with Royale: In a browser context should
> close the browser Tab and in a Desktop/Electron should close the window.
> This is possible ?