Deployed app terminates after a MessageBox is displayed before main app shell view is opened

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Deployed app terminates after a MessageBox is displayed before main app shell view is opened

Ravi
I was having a problem with running my deployed app which seems to be
caused by displaying a MessageBox before the main app shell is opened.
It can be replicated with other deployed apps.

For example, when I deploy and run the Video Library sample
application, it runs fine. However, if I add a MessageBox before
'VideoLibraryShell show' as shown below, the deployed app terminates
after displaying the MessageBox for a split second. It doesn't wait
for any user input.

VideoLibrarySessionManager>>main
        "Start up the Dolphin Video Library sample application"

        MessageBox notify: 'Here goes nothing!'.
        VideoLibraryShell show

The same thing happens if I place the MessageBox line in ...

VideoLibraryShell>>onViewOpened

        super onViewOpened.
        self onTapeSelected.
        MessageBox notify: 'Here goes nothing!!!'

In a Development image, it executes as per the code. But as a deployed
EXE, I first see the Dolphin Evaluation warning messagebox (as I'm
using Dolphin 4 Pro Evaluation), and then it terminates. All I saw was
the MessageBox (MessageBox notify: 'Here goes nothing!!!') appearing
and disappearing quickly just before it quit.

Thanks and Best Regards,
Ravi


Reply | Threaded
Open this post in threaded view
|

Re: Deployed app terminates after a MessageBox is displayed before main app shell view is opened

Blair McGlashan
Ravi

You wrote in message news:[hidden email]...
> I was having a problem with running my deployed app which seems to be
> caused by displaying a MessageBox before the main app shell is opened.
> It can be replicated with other deployed apps.
> ...

This is a known issue: If you are going to open a message box before any
other windows during Dolphin's startup processing, then you must make it
#taskModal. If you don't then the "startup" process is suspended when the
message box is opened. This will allow the background idle loop to notice
that there are no windows open (the MessageBox is not considered to be a
Dolphin window). What happens next is the responsibility of the installed
SessionManager (more precisely its #keepAlive method), but the default
behaviour is to initiate system shutdown because there are no windows open.

To avoid this happenning, either:
a) Use a task modal MessageBox (e.g. MessageBox new taskModal; notify:
'Hello'); or
b) ensure that your MessageBox is opened after the shell window; or
c) override #keepAlive.

If you override #keepAlive to do nothing (for example), then you will need
to explicitly initiate system shutdown, for example when your main shell
window is closed. Obviously the easiest thing to do is to use a task modal
message box.

You should also avoid using a message box which is not task modal on system
shutdown (e.g. to prompt the user as to whether they really want to shut
down), as this may also cause problems.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Deployed app terminates after a MessageBox is displayed before main app shell view is opened

Ravi
Blair,

"Blair McGlashan" <[hidden email]> wrote in message news:<a1n4au$rqmcm$[hidden email]>...

> Ravi
>
> You wrote in message news:[hidden email]...
> > I was having a problem with running my deployed app which seems to be
> > caused by displaying a MessageBox before the main app shell is opened.
> > It can be replicated with other deployed apps.
> > ...
>
> This is a known issue: If you are going to open a message box before any
> other windows during Dolphin's startup processing, then you must make it
> #taskModal. If you don't then the "startup" process is suspended when the
> message box is opened. This will allow the background idle loop to notice
> that there are no windows open (the MessageBox is not considered to be a
> Dolphin window). What happens next is the responsibility of the installed
> SessionManager (more precisely its #keepAlive method), but the default
> behaviour is to initiate system shutdown because there are no windows open.
>
> To avoid this happenning, either:
> a) Use a task modal MessageBox (e.g. MessageBox new taskModal; notify:
> 'Hello'); or
> b) ensure that your MessageBox is opened after the shell window; or
> c) override #keepAlive.
>
> If you override #keepAlive to do nothing (for example), then you will need
> to explicitly initiate system shutdown, for example when your main shell
> window is closed. Obviously the easiest thing to do is to use a task modal
> message box.
>
> You should also avoid using a message box which is not task modal on system
> shutdown (e.g. to prompt the user as to whether they really want to shut
> down), as this may also cause problems.
>
> Regards
>
> Blair

Thanks for the explanation!

But I wonder if this issue has been documented somewhere, like a
'known issues' webpage, that I didn't know about.

Best Regards,
Ravi