Skip to main content

LensStudio:Ui.CloseEvent

Class

Event 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

Event.accept


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

Event.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

Event.getTypeName


ignore()

ignore(): void

Marks the event as unhandled so it propagates to parent widgets.

Returns

void

Inherited from

Event.ignore


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

Event.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

Event.isSame