LensStudio:Ui.CloseEvent
ClassEvent triggered when a window or dialog closes.
Index
Example
// CloseEvent is delivered via Widget.onClose when a window or dialog
// is about to close. Use accept() to allow closing or ignore() to prevent it.
const gui = this.pluginSystem.findInterface(IGui.interfaceId) as IGui;
const dialog = gui.createDialog();
dialog.windowTitle = 'CloseEvent Demo';
dialog.resize(300, 100);
this.connections.push(
dialog.onClose.connect((event: CloseEvent) => {
// Prevent the first close attempt
event.ignore();
console.log('Close rejected via CloseEvent.ignore()');
})
);
Extends
Methods
accept()
accept():
void
Marks the event as handled so it will not propagate further.
Returns
void
Inherited from
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
ignore()
ignore():
void
Marks the event as unhandled so it propagates to parent widgets.
Returns
void
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean