Element: window.delete { }

Type

callback

Description

The command procedure to be executed when an attempt to delete the window either via an operating system action, or via a wdelete command. When such a delete procedure is defined for a window and is invoked, the window identifier is passed to the procedure as a parameter, and it is left to the procedure to delete the window, by using the wdelete command.

Deleting a top-level window with sub-windows will not invoke the window.delete callback of sub-windows, this must be done explicitly within the top-level callback, e.g.

topwin.delete = {
    args w=window
    for i=1,w.child_count { wdelete w.child[i] }
}

This will ensure that all sub-window destructors get called, although if the sub-windows have no destructor callbacks then this code is unnecessary.

Parameters

window.delete (<window>)

Examples

win1.delete = {
    args w=window
    ifyes 'Are you sure',-n { wdelete w }
}

See Also

Commands:

wdelete