MessageBox doesnt stay open in deployed image

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

MessageBox doesnt stay open in deployed image

ar-2
MyRuntimeSessionManager>>main calls MyShell class>>show which looks something
like this:

MyShell class>>show

        self cantContinueForSomeReason ifTrue:[
                MessageBox notify: 'cant continue for some reason'.
                ^nil].
        ^super show

Why does this just flash the message box and then disappear? From my testing
it seems like the #notify: is not modal, ie it returns ^nil right away and
then I guess the image shuts down, closing the messagebox.

But even the following shows the same behavior of flashing and shutting down:

MyShell class>>show

        self shouldWarnAboutSomething ifTrue:[
                MessageBox notify: 'warning about something'].
        ^super show.

the shell is not shown.

Also, is there an easy way to test an application in development via
MyRuntimeSessionManager instead starting at MyShell show? Just starting the
shell I cant really test end-to-end.


Reply | Threaded
Open this post in threaded view
|

Re: MessageBox doesnt stay open in deployed image

Ravi
AR,

ar <[hidden email]> wrote in message news:<[hidden email]>...

> MyRuntimeSessionManager>>main calls MyShell class>>show which looks something
> like this:
>
> MyShell class>>show
>
> self cantContinueForSomeReason ifTrue:[
> MessageBox notify: 'cant continue for some reason'.
> ^nil].
> ^super show
>
> Why does this just flash the message box and then disappear? From my testing
> it seems like the #notify: is not modal, ie it returns ^nil right away and
> then I guess the image shuts down, closing the messagebox.
>

I posted this problem last month and it was answered by Blair. See
post entitled "Deployed app terminates after a MessageBox is displayed
before main app shell view is opened". The easy solution is to make
the MessageBox taskModal:

MessageBox new taskModal; notify: 'can continue now'

However, I'm now having a similar problem with Prompters. I don't know
how to make Prompters taskModal so it gets closed together with my
splash screen. And the problem seems to occur with any Dialog. I
worked around it by displaying a taskModal MessageBox before
displaying the Prompter.

> Also, is there an easy way to test an application in development via
> MyRuntimeSessionManager instead starting at MyShell show? Just starting the
> shell I cant really test end-to-end.

I like to know this too.

Regards,
Ravi


Reply | Threaded
Open this post in threaded view
|

Re: MessageBox doesnt stay open in deployed image

ar-2
Ravi,

Thanks.

>However, I'm now having a similar problem with Prompters. I don't know
>how to make Prompters taskModal so it gets closed together with my
>splash screen. And the problem seems to occur with any Dialog.

What I did as a stopgap was to imitate a MessageBox with a Dialog and a
resource with a static text in it and open it #showModal. This eliminated the
problem so I think you should be able to use a Dialog if you open it
#showModal.

regards,
alan r


Reply | Threaded
Open this post in threaded view
|

Re: MessageBox doesnt stay open in deployed image

Don Rylander-3
ar and Ravi,

You might want to take a look at SessionManager>>keepAlive.  If you're having
to make a bunch of awkward changes just to deal with this particular behavior,
it might be cleaner to set up your own mechanism that determines whether your
app should terminate.

Don


Reply | Threaded
Open this post in threaded view
|

Re: MessageBox doesnt stay open in deployed image

Ravi
In reply to this post by ar-2
Alan,

ar <[hidden email]> wrote in message news:<0JdwPGQPIP+Ro7pf=[hidden email]>...

> Ravi,
>
> Thanks.
>
> >However, I'm now having a similar problem with Prompters. I don't know
> >how to make Prompters taskModal so it gets closed together with my
> >splash screen. And the problem seems to occur with any Dialog.
>
> What I did as a stopgap was to imitate a MessageBox with a Dialog and a
> resource with a static text in it and open it #showModal. This eliminated the
> problem so I think you should be able to use a Dialog if you open it
> #showModal.
>
> regards,
> alan r

Actually I did open the Prompter with #showModal. Problem is it only
stays open as long as the splash screen is being shown. When the
splash screen goes away, the Prompter gets closed too. Like Don said I
should look at SessionManager>>keepAlive.

Thanks for the suggestion anyway.

Regards,
Ravi


Reply | Threaded
Open this post in threaded view
|

Re: MessageBox doesnt stay open in deployed image

Ravi
In reply to this post by Don Rylander-3
Don,

"Don Rylander" <[hidden email]> wrote in message news:<a4raio$2euoa$[hidden email]>...
> ar and Ravi,
>
> You might want to take a look at SessionManager>>keepAlive.  If you're having
> to make a bunch of awkward changes just to deal with this particular behavior,
> it might be cleaner to set up your own mechanism that determines whether your
> app should terminate.
>
> Don

True... Fortunately, the messagebox I added serves a very useful
purpose and it and a prompter only appear when my program is run for
the first time.

Regards,
Ravi