Discussion:
Event issue?
Jean-Luc Arnaud
2017-03-23 17:29:33 UTC
Permalink
Unless it's an issue, I don't definitely understand what happens with
Events when launching an App.

In a simple project, I code this:

App Open Event

Message=Message+"App Open event"+EndOfLine ' Message is a property
of App

App OpenDocument Event

Window1.TextArea1.appendtext "App OpenDocument event"+EndOfLine '
Window1 is the main window, implicitly opened by App, with a TextArea

Window1 Open Event

TextArea1.AppendText App.Message+"Window1 Open event"+EndOfLine

And I define a filetype in order to launch the App by double-clicking a
file with the same filetype/extension.

Now:

- Launching the app by double-click, I get what is expected, that is
"App Open event" and "Window1 Open event" in TextArea1

- Double-clicking the file while the app is opened, I get the expected
"App OpenDocument event" added to TextArea1

- But launching the app by double-clicking the file (the app is not
running), I only get "App Open event" and "App OpenDocument event" in
TextArea1. It seems like the Window1 Open event doesn't fire. I tried to
add a MsgBox message in the Window1 Open event, it's not displayed.

How is this possible?


Am I wrong somewhere (likely) or is this a known or unknown issue?

Thanks for any help.
--
Jean-Luc Arnaud


_______________________________________________

Xojo forum:

https://forum.xojo.com/
Jon Ogden
2017-03-23 17:46:33 UTC
Permalink
What happens if you step through everything in the debugger? I know that’s painful, but it could let you see what’s happening…
Unless it's an issue, I don't definitely understand what happens with Events when launching an App.
App Open Event
Message=Message+"App Open event"+EndOfLine ' Message is a property of App
App OpenDocument Event
Window1.TextArea1.appendtext "App OpenDocument event"+EndOfLine ' Window1 is the main window, implicitly opened by App, with a TextArea
Window1 Open Event
TextArea1.AppendText App.Message+"Window1 Open event"+EndOfLine
And I define a filetype in order to launch the App by double-clicking a file with the same filetype/extension.
- Launching the app by double-click, I get what is expected, that is "App Open event" and "Window1 Open event" in TextArea1
- Double-clicking the file while the app is opened, I get the expected "App OpenDocument event" added to TextArea1
- But launching the app by double-clicking the file (the app is not running), I only get "App Open event" and "App OpenDocument event" in TextArea1. It seems like the Window1 Open event doesn't fire. I tried to add a MsgBox message in the Window1 Open event, it's not displayed.
How is this possible?
Am I wrong somewhere (likely) or is this a known or unknown issue?
Thanks for any help.
--
Jean-Luc Arnaud
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo for
Marnaud
2017-03-23 17:51:26 UTC
Permalink
Post by Jon Ogden
What happens if you step through everything in the debugger? I know that’s painful, but it could let you see what’s happening…
Well, you can’t start a debug app by double-clicking on one of its files; if I get it right, it’s what Jean-Luc has troubles with.
_______________________________________________

Xojo forum:

https://forum.xojo.com/
Marnaud
2017-03-23 18:03:18 UTC
Permalink
Post by Marnaud
Post by Jon Ogden
What happens if you step through everything in the debugger? I know that’s painful, but it could let you see what’s happening…
Well, you can’t start a debug app by double-clicking on one of its files; if I get it right, it’s what Jean-Luc has troubles with.
I’m wrong. You can “Run Paused” and drag&drop a file on the debug file. Sorry for the noise.
_______________________________________________

Xojo forum:

https://forum.xojo.com/
Jean-Luc Arnaud
2017-03-24 08:39:21 UTC
Permalink
But you can't start it by double-click on a file.

Jean-Luc Arnaud
Post by Marnaud
Post by Marnaud
Post by Jon Ogden
What happens if you step through everything in the debugger? I know that’s painful, but it could let you see what’s happening…
Well, you can’t start a debug app by double-clicking on one of its files; if I get it right, it’s what Jean-Luc has troubles with.
I’m wrong. You can “Run Paused” and drag&drop a file on the debug file. Sorry for the noise.
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https://forum.xojo.com/
Jon Ogden
2017-03-24 11:49:58 UTC
Permalink
In that case then use a log file. The MsgBox can mess things up when trying to look at events like this. Log file is much better.

Sent from my iPhone
Post by Jean-Luc Arnaud
But you can't start it by double-click on a file.
Jean-Luc Arnaud
Post by Marnaud
Post by Marnaud
Post by Jon Ogden
What happens if you step through everything in the debugger? I know that’s painful, but it could let you see what’s happening…
Well, you can’t start a debug app by double-clicking on one of its files; if I get it right, it’s what Jean-Luc has troubles with.
I’m wrong. You can “Run Paused” and drag&drop a file on the debug file. Sorry for the noise.
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
emile.a.schwarz
2017-03-24 12:39:18 UTC
Permalink
I used recently a Listbox to report stuff (time in Column 0, Message in Column 1).

 

 

It may be appropriate in some cases, or add a TextArea and place your log there.

 

Both as a debug facility, of course, will be removed before the application release.

 

Emile

 
Message du 24/03/17 12:50
De : "Jon Ogden"
A : "Nug"
Objet : Re: Event issue?
In that case then use a log file. The MsgBox can mess things up when trying to look at events like this. Log file is much better. Sent from my iPhone > On Mar 24, 2017, at 3:39 AM, Jean-Luc Arnaud wrote: > > But you can't start it by double-click on a file. > > Jean-Luc Arnaud > >> Le 23/03/2017 à 19:03, Marnaud a écrit : >>> Le 23 mars 2017 à 18:51, Marnaud a écrit: >>> >>>> Le 23 mars 2017 à 18:46, Jon Ogden a écrit: >>>> >>>> What happens if you step through everything in the debugger? I know that’s painful, but it could let you see what’s happening… >>> Well, you can’t start a debug app by double-clicking on one of its files; if I get it right, it’s what Jean-Luc has troubles with. >> I’m wrong. You can “Run Paused” and drag&drop a file on the debug file. Sorry for the noise. >> _______________________________________________ >> >> Xojo forum: >> >> https://forum.xojo.com/ >> > > > _______________________________________________ > > Xojo forum: > > https://forum.xojo.com/ _______________________________________________ Xojo forum: https://forum.xojo.com/
_______________________________________________

Xojo
vaughnsc .
2017-03-24 12:59:48 UTC
Permalink
Just curious, why would 'drag and drop <file>' and 'double-click
<associated file>' be different for debugging? The same events would be
fired, unless I'm mistaken.
Post by emile.a.schwarz
I used recently a Listbox to report stuff (time in Column 0, Message in Column 1).
It may be appropriate in some cases, or add a TextArea and place your log there.
Both as a debug facility, of course, will be removed before the application release.
Emile
Message du 24/03/17 12:50
De : "Jon Ogden"
A : "Nug"
Objet : Re: Event issue?
In that case then use a log file. The MsgBox can mess things up when
trying to look at events like this. Log file is much better. Sent from my
iPhone > On Mar 24, 2017, at 3:39 AM, Jean-Luc Arnaud wrote: > > But you
can't start it by double-click on a file. > > Jean-Luc Arnaud > >> Le
23/03/2017 à 19:03, Marnaud a écrit : >>> Le 23 mars 2017 à 18:51, Marnaud
a écrit: >>> >>>> Le 23 mars 2017 à 18:46, Jon Ogden a écrit: >>>> >>>>
What happens if you step through everything in the debugger? I know that’s
painful, but it could let you see what’s happening… >>> Well, you can’t
start a debug app by double-clicking on one of its files; if I get it
right, it’s what Jean-Luc has troubles with. >> I’m wrong. You can “Run
Paused” and drag&drop a file on the debug file. Sorry for the noise. >>
_______________________________________________ >> >> Xojo forum: >> >>
https://forum.xojo.com/ >> > > > _______________________________________________
Xojo forum: > > https://forum.xojo.com/ _______________________________________________
Xojo forum: https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo for
Jean-Luc Arnaud
2017-03-24 14:00:40 UTC
Permalink
Not exactly, because double-clicking a file while the app is not running
will fire the Open event of the app.

I made a lot of test and it results that :

- In some cases, it seems like OpenDocument could fire before the Open
event,

- But I have been unable to reproduce, and so to determine, when and why,

- And now, I get this new behavior, where the Open event of the implicit
window does not fire when OpenDocument has fired, maybe because it
interrupts the Window Open event code very early, before any code has
been run int this Open event. I don't even know if this is possible...

Did anyone try to run my little project (see first message of the thread)?

Thanks for your interest.

Jean-Luc Arnaud
Post by vaughnsc .
Just curious, why would 'drag and drop <file>' and 'double-click
<associated file>' be different for debugging? The same events would be
fired, unless I'm mistaken.
Post by emile.a.schwarz
I used recently a Listbox to report stuff (time in Column 0, Message in Column 1).
It may be appropriate in some cases, or add a TextArea and place your log there.
Both as a debug facility, of course, will be removed before the application release.
Emile
Message du 24/03/17 12:50
De : "Jon Ogden"
A : "Nug"
Objet : Re: Event issue?
In that case then use a log file. The MsgBox can mess things up when
trying to look at events like this. Log file is much better. Sent from my
iPhone > On Mar 24, 2017, at 3:39 AM, Jean-Luc Arnaud wrote: > > But you
can't start it by double-click on a file. > > Jean-Luc Arnaud > >> Le
23/03/2017 à 19:03, Marnaud a écrit : >>> Le 23 mars 2017 à 18:51, Marnaud
a écrit: >>> >>>> Le 23 mars 2017 à 18:46, Jon Ogden a écrit: >>>> >>>>
What happens if you step through everything in the debugger? I know that’s
painful, but it could let you see what’s happening… >>> Well, you can’t
start a debug app by double-clicking on one of its files; if I get it
right, it’s what Jean-Luc has troubles with. >> I’m wrong. You can “Run
Paused” and drag&drop a file on the debug file. Sorry for the noise. >>
_______________________________________________ >> >> Xojo forum: >> >>
https://forum.xojo.com/ >> > > > _______________________________________________
Xojo forum: > > https://forum.xojo.com/ _______________________________________________
Xojo forum: https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

Jean-Luc Arnaud
2017-03-24 13:52:16 UTC
Permalink
Hi Emile,

Thanks for ideas.

Jean-Luc Arnaud
Post by emile.a.schwarz
I used recently a Listbox to report stuff (time in Column 0, Message in Column 1).
It may be appropriate in some cases, or add a TextArea and place your log there.
Both as a debug facility, of course, will be removed before the application release.
Emile
Message du 24/03/17 12:50
De : "Jon Ogden"
A : "Nug"
Objet : Re: Event issue?
In that case then use a log file. The MsgBox can mess things up when trying to look at events like this. Log file is much better. Sent from my iPhone > On Mar 24, 2017, at 3:39 AM, Jean-Luc Arnaud wrote: > > But you can't start it by double-click on a file. > > Jean-Luc Arnaud > >> Le 23/03/2017 à 19:03, Marnaud a écrit : >>> Le 23 mars 2017 à 18:51, Marnaud a écrit: >>> >>>> Le 23 mars 2017 à 18:46, Jon Ogden a écrit: >>>> >>>> What happens if you step through everything in the debugger? I know that’s painful, but it could let you see what’s happening… >>> Well, you can’t start a debug app by double-clicking on one of its files; if I get it right, it’s what Jean-Luc has troubles with. >> I’m wrong. You can “Run Paused” and drag&drop a file on the debug file. Sorry for the noise. >> _______________________________________________ >> >> Xojo forum: >> >> https://forum.xojo.com/ >> > > > _______________________________________________ > > Xojo forum: > > https://forum.xojo.com/ _______________________________________________ Xojo forum: https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo f
Jean-Luc Arnaud
2017-03-24 13:51:38 UTC
Permalink
Thanks for your advice, Jon

Jean-Luc Arnaud
Post by Jon Ogden
In that case then use a log file. The MsgBox can mess things up when trying to look at events like this. Log file is much better.
Sent from my iPhone
Post by Jean-Luc Arnaud
But you can't start it by double-click on a file.
Jean-Luc Arnaud
Post by Marnaud
Post by Marnaud
Post by Jon Ogden
What happens if you step through everything in the debugger? I know that’s painful, but it could let you see what’s happening…
Well, you can’t start a debug app by double-clicking on one of its files; if I get it right, it’s what Jean-Luc has troubles with.
I’m wrong. You can “Run Paused” and drag&drop a file on the debug file. Sorry for the noise.
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https://for
Jean-Luc Arnaud
2017-03-24 08:38:18 UTC
Permalink
Yes, you're right.

It's only possible to use either a log file or Msgbox, like I do.

Jean-Luc Arnaud
Post by Marnaud
Post by Jon Ogden
What happens if you step through everything in the debugger? I know that’s painful, but it could let you see what’s happening…
Well, you can’t start a debug app by double-clicking on one of its files; if I get it right, it’s what Jean-Luc has troubles with.
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https://forum.xojo.com/
Continue reading on narkive:
Loading...