Choose Language Hide Translation Bar
Highlighted
DavidLeber
Level III

onClose() Events & Graceful Exit

I'm putting together  a GUI front-end for a program that I'm writing. I'm doing this by writing a Journal from a JSL script. The GUI opens up several sub-Journals.

 

What I'm frustrated by is that each Journal, when exited using the red "X" in the top right, is asking the user if they want to save it. With how I'm using these Journals, the user should never be saving the journals - it's only a front end to the main program.

 

Is there any way to change the default behavior of the red "X" to have it not ask to save? Or is there another way to ensure that each program exits gracefully, without asking to save?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Craige_Hales
Staff (Retired)

Re: onClose() Events & Graceful Exit

Alternatively, use newWindow without the <<journal. 

Craige

View solution in original post

2 REPLIES 2
Highlighted
Craige_Hales
Staff (Retired)

Re: onClose() Events & Graceful Exit

starting in JMP 14 you can clear the dirty flag in the journal.

xx = newwindow("xx",<<journal,buttonbox("hello"));
xx<<setDirty(0);

Prior to that you might pre-save the journal in $TEMP to avoid the dialog. Or...

xx<<closewindow("nosave")

also works without prompting. You might have some success with this:

xx = newwindow("xx",<<journal,buttonbox("hello"));
xx<<onclose(xx<<closewindow("nosave"));
Craige
Highlighted
Craige_Hales
Staff (Retired)

Re: onClose() Events & Graceful Exit

Alternatively, use newWindow without the <<journal. 

Craige

View solution in original post

Article Labels

    There are no labels assigned to this post.