Added on-close callbacks to the TextBox and example script.