I want to show a warning dialog to the user when a chart window is closed and close the associated data table (without saving) if the user selects OK and keep both the data table and the chart, if the user selects "Cancel".
The script below is for the dialog box I want, but where do I need to put the statement for closing [if OK] or keeping [if Cancel] the data table?
gb << On Close(
New Window( "Are you sure?",
<<modal,
V List Box(
Text Box( "This will close the associated data table" ),
H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
)
)["button"] == 1
);