Edit:onChange() event


This event is fired when the user has modified the Edit text content or format.

Changing Edit content text or format during this event is possible and will not throw others onChange events.

Return value

The event returns no value.

Example

local ui = require "ui" local win = ui.Window("Edit:onChange() sample", "fixed", 340, 230) local button = ui.Button(win, "Click me", 10, 10) local edit = ui.Edit(win, "Click the button to throw the Edit:onChange() event", button.x + button.width + 8, button.y) edit.readonly = true -- set a onClick() event : hides the Edit function button:onClick() edit.text = "This is a new text to throw Edit:onChange() event" end function edit:onChange() ui.info("Edit widget has changed !") end win:show() while win.visible do ui.update() end