You are here: Lua Scripting Resources eGuide > Lua Scripting API Reference Guide > 2D Editor Library > setSizeChangeListener

3.22 setSizeChangeListener

D2Editor:setSizeChangeListener(function(editor, w, h))

Sets the callback function for when the editor contents exceed the current editor size, when the contents fit on fewer lines, or when the contents fit on a single line of smaller width. This function can then resize the editor appropriately. The callback function should be a void function. It will be passed into the following parameters:

Parameter

Description

editor

w

h

Editor in which the expression changed size.

Optimal widget width to t the expression.

Optimal widget height to t the expression.

Returns the text editor object.

Info

To remove the listener, call D2Editor:setSizeChangeListener(nil)

Introduced in platform.apiLevel = '2.0'