 |
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
|
_________________ Sic itur ad astra. |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sat Jul 03, 2010 11:58 pm |
Can you be more specific? As I understand it's supposed to fire on clicking on the CMUD 'x', closing the session window, and going to the menu and choosing either File -> Close or File -> Close All.
Did you mean one of those? |
|
_________________ Asati di tempari! |
|
|
 |
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Sun Jul 04, 2010 3:12 am |
No, I mean that when I close any window during the session the event will fire. That is why my current onExit event code is like this:
| Code: |
<event event="onExit" priority="1250" id="125">
<value>#IF (%window = @Windowname) {comreset} //To accomodate how onExit works at the present time.</value>
</event>
|
I verify that the main window is closing before I do anything.
(WindowName = %session.WindowName)
EDIT: Very easy to test. Put an #ECHO or #PRINT in your event script. Then create a window and close it. The string will be output to the screen. If you have an open window that you don't need, closing it will do the trick. |
|
_________________ Sic itur ad astra. |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Jul 04, 2010 5:35 am |
Confirmed.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Mon Jul 05, 2010 12:51 am |
Is anyone else having CMUD give them a crash error whenever they simply try to close the main session window?
|
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Jul 05, 2010 4:50 am |
1)Chamenas should probably start a new thread
2)nope, but it might be related to the reconnect AV that's been reported |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Wed Jul 07, 2010 9:41 pm |
It also seems that the only time this event won't fire is when the X on the upper right hand corner is clicked.
|
|
_________________ Sic itur ad astra. |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jul 07, 2010 10:42 pm |
Well, technically this is correct. Events don't care who fires them. They are not aliases or triggers. For example, think about an "onPrompt" event. When this event is fired you want it to execute any onPrompt event defined in any window and any package.
So onExit is doing this too. When you close a window, the onExit window fires, which causes *any* onExit script to run. The only reason this didn't happen in the past was because onExit was not getting fired by closing a window (which was a bug).
I'm not sure how I can change this without adding some weird kludged exception to how onExit works compared to any other event. |
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Jul 07, 2010 11:19 pm |
Does the onExit event include any parameters? Such as the window name? If so, users could test the name of the window. This would actually be useful be useful in several ways, I think.
|
|
|
|
 |
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Thu Jul 08, 2010 12:07 am |
When the onExit event fires, the %window variable will contain the window name.
|
|
_________________ Sic itur ad astra. |
|
|
 |
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Thu Jul 08, 2010 12:23 am |
| Anaristos wrote: |
| It also seems that the only time this event won't fire is when the X on the upper right hand corner is clicked. |
I meant by this that the event will fire on all window closings but it won't fire if one exits the application completely either by the above method or by clicking on File|Exit. I am thinking this is still a bug. |
|
_________________ Sic itur ad astra. |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Jul 08, 2010 4:14 pm |
| Quote: |
| I meant by this that the event will fire on all window closings but it won't fire if one exits the application completely either by the above method or by clicking on File|Exit. I am thinking this is still a bug. |
There isn't much I can do about this. When you click the X button or use File/Exit you are telling Windows to immediately close the application. In fact, the X button bypasses many of the normal Windows messages that File/Exit normally executes. Running a script (like onExit) creates a thread, but Windows tries to close all threads when it exits an application. So to do this I would need to add a delay to wait until the script thread exits. I really hate adding any code to the application close routine that waits on anything. It would be really easy to screw up your script and cause CMUD to crash on exit or just hang.
I'm really going to need to think about all of this. I'm really starting to think that onExit is more trouble than it's worth for the vast majority of users. |
|
|
|
 |
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Thu Jul 08, 2010 10:41 pm |
Well, any onExit event is better than no onExit event. I can live with the way it works now.
|
|
_________________ Sic itur ad astra. |
|
|
 |
|
|
|