Webview:onCreate() event


This event is fired when the Webview object has just been created (just after the Webview:constructor() call).

This event is particularly interesting when you want to initialize its properties.

Return value

The event returns no value.

Example

local ui = require "ui" require "webview" -- creates a simple window local win = ui.Window("Webview:onCreate() event sample", 320, 200) local Webview = ui.Webview(win, "https://www.luart.org", 150, 70) -- Webview:onCreate() event to center the Webview widget function Webview:onCreate() Webview:center() end win:show() -- update the ui while win.visible do ui.update() end