How do I intercept a window close event?I'm building an app and I want to prevent the window from being closed if the user presses "X" to close the window. To my knowledge, "On Close" only allows me to handle what goes on when the window is closed. I can't cancel the window close event.
Please help me find documentation or a solution to this. Thanks in advance!
Re: How do I intercept a window close event?And, if you always return 0, you may have a hard time closing JMP!
Re: How do I intercept a window close event?This is a little late, but you can return 0 from the On Close script to prevent the window from closing.
Names default to here(1);
win = New Window("Close Me", Show Menu(0), Show Toolbars(0),
V List Box(
teb = text edit box("")
)
) << On Close(
if(
length( teb << get text ) > 0,
1,
New Window("Enter a value", << modal(1), Show Menu(0), Show Toolbars(0), text box("you must enter a value to continue"));
0;
)
);