Strange exe behavior

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

Strange exe behavior

Sebastián Sastre
Hi all,

    I need that an application ask a couple of things before to run
(including it's splash) and I'm having suprising results.

    I made the AppXSessionManager>>main method something like this:

AppXSessionManager>>main

ApplicationXConfiguration existsConfigurationFile ifFalse:[
    ApplicationXConfiguration initializeConfiguration.
    personalization := PropertiesAppXDialog showModalOn:
ApplicationXConfiguration current properties.
    personalization notNil ifTrue:[ ApplicationXConfiguration current
personalization: personalization ; persist ].
].
self isUpdated ifFalse:[
    MessageBox
        caption: 'Answer please...'
        confirm: '..Something is older than 7 days. Probably there is an
update.
¿Do you want to run LiveUpdate now?'
        onYes: [^self callLiveUpdate]
        onNo: [self mainShellClass show] onCancel: [^self exit]].

self mainShellClass show.

    The strange thing cames when I close the PropertiesAppXDialog. I can see
that after accepting the properties, the MesageBox apears and instantly
disappears exacly like cancelling it and the whole application exits.

    Why the acceptance of this dialog affect the posterior MessageBox?

    In a previous attempt I had a similar problem with the application
splash: the MessageBox or the PropertiesDielog was there while the splash
where showed (4 seconds for a #showTimed).

    I'm sensing the presence of windows vodoo stuf here... anybody knows how
can one be safe from that?

    thanks,

Sebastián


Reply | Threaded
Open this post in threaded view
|

Re: Strange exe behavior

Blair McGlashan-3
"Sebastián Sastre" <[hidden email]> wrote in message
news:[hidden email]...

> Hi all,
>
>    I need that an application ask a couple of things before to run
> (including it's splash) and I'm having suprising results.
>
>    I made the AppXSessionManager>>main method something like this:
>
> AppXSessionManager>>main
>
> ApplicationXConfiguration existsConfigurationFile ifFalse:[
>    ApplicationXConfiguration initializeConfiguration.
>    personalization := PropertiesAppXDialog showModalOn:
> ApplicationXConfiguration current properties.
>    personalization notNil ifTrue:[ ApplicationXConfiguration current
> personalization: personalization ; persist ].
> ].
> self isUpdated ifFalse:[
>    MessageBox
>        caption: 'Answer please...'
>        confirm: '..Something is older than 7 days. Probably there is an
> update.
> ¿Do you want to run LiveUpdate now?'
>        onYes: [^self callLiveUpdate]
>        onNo: [self mainShellClass show] onCancel: [^self exit]].
>
> self mainShellClass show.
>
>    The strange thing cames when I close the PropertiesAppXDialog. I can
> see
> that after accepting the properties, the MesageBox apears and instantly
> disappears exacly like cancelling it and the whole application exits.
>
>    Why the acceptance of this dialog affect the posterior MessageBox?
>
>    In a previous attempt I had a similar problem with the application
> splash: the MessageBox or the PropertiesDielog was there while the splash
> where showed (4 seconds for a #showTimed).
>
>    I'm sensing the presence of windows vodoo stuf here... anybody knows
> how
> can one be safe from that?

There is always a simpler explanation for apparent magic :-). Probably what
is happening here is that the SessionManager keep-alive mechanism is killing
off the application because if finds no windows to be open (message boxes
are not condidered to be windows in this context). You can disable this
mechanism by overriding #keepAlive in your session manager to do nothing.
You then need to cause the application to terminate explicity when the main
shell is closed, e.g. by overriding #onViewClosed as follows:

    SessionManager current isRuntime ifTrue: [SessionManager current exit]

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Strange exe behavior

Sebastián Sastre
Thank you Blair, that tip helps me on time,

    regards,

Seb

"Blair McGlashan" <[hidden email]> escribió en el mensaje
news:[hidden email]...

> "Sebastián Sastre" <[hidden email]> wrote in message
> news:[hidden email]...
> > Hi all,
> >
> >    I need that an application ask a couple of things before to run
> > (including it's splash) and I'm having suprising results.
> >
> >    I made the AppXSessionManager>>main method something like this:
> >
> > AppXSessionManager>>main
> >
> > ApplicationXConfiguration existsConfigurationFile ifFalse:[
> >    ApplicationXConfiguration initializeConfiguration.
> >    personalization := PropertiesAppXDialog showModalOn:
> > ApplicationXConfiguration current properties.
> >    personalization notNil ifTrue:[ ApplicationXConfiguration current
> > personalization: personalization ; persist ].
> > ].
> > self isUpdated ifFalse:[
> >    MessageBox
> >        caption: 'Answer please...'
> >        confirm: '..Something is older than 7 days. Probably there is an
> > update.
> > ¿Do you want to run LiveUpdate now?'
> >        onYes: [^self callLiveUpdate]
> >        onNo: [self mainShellClass show] onCancel: [^self exit]].
> >
> > self mainShellClass show.
> >
> >    The strange thing cames when I close the PropertiesAppXDialog. I can
> > see
> > that after accepting the properties, the MesageBox apears and instantly
> > disappears exacly like cancelling it and the whole application exits.
> >
> >    Why the acceptance of this dialog affect the posterior MessageBox?
> >
> >    In a previous attempt I had a similar problem with the application
> > splash: the MessageBox or the PropertiesDielog was there while the
splash
> > where showed (4 seconds for a #showTimed).
> >
> >    I'm sensing the presence of windows vodoo stuf here... anybody knows
> > how
> > can one be safe from that?
>
> There is always a simpler explanation for apparent magic :-). Probably
what
> is happening here is that the SessionManager keep-alive mechanism is
killing
> off the application because if finds no windows to be open (message boxes
> are not condidered to be windows in this context). You can disable this
> mechanism by overriding #keepAlive in your session manager to do nothing.
> You then need to cause the application to terminate explicity when the
main
> shell is closed, e.g. by overriding #onViewClosed as follows:
>
>     SessionManager current isRuntime ifTrue: [SessionManager current exit]
>
> Regards
>
> Blair
>
>