Panel:onCreate() event


This event is fired when the Panel object has just been created, just after the Panel: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" -- create a fixed Panel local win = ui.Window("Panel:onCreate() event sample", "fixed", 320, 200) -- create a Panel local panel = ui.Panel(win, 0, 0, 100, 100) function panel:onCreate() self.bgcolor = 0xFFFFFF self.border = true self:center() end ui.run(win):wait()