If function when checkBox is checked and unchecked
//Define Function1
...
Function1 = Function( {},
// Code for function 1 goes here
Print("Checkbox is checked! Function 1 executed.");
);
// Define function 2
Function2 = Function( {},
// Code for function 2 goes here
Print("Checkbox is unchecked! Function 2 executed.");
);
// Create a new window
nw = New Window( "Checkbox Example",
<< Modal,
// Add a checkbox to the window