This event is particularly interesting when you want to initialize its properties.
Tab:onCreate() event
This event is fired when the Tab object has just been created (just after the Tab:constructor() call).
Return value
The event returns no value.Example
local ui = require "ui"
-- creates a simple window
local win = ui.Window("Tab:onCreate() event sample", 320, 260)
local tab = ui.Tab(win, {"0"})
-- Increment Tab.text each second
async(function()
while true do
sleep(1000)
tab.items[1].text = tab.items[1].text + 1
end
end)
ui.run(win):wait()