auto resize menu width

This commit is contained in:
Eduardo Bart
2012-01-04 09:24:29 -02:00
parent b8150d160e
commit 1c4bbfb7f3
7 changed files with 25 additions and 4 deletions

View File

@@ -47,7 +47,17 @@ end
function createWidget(style, parent)
local className = g_ui.getStyleClass(style)
if className == "" then
error('could not find style ' .. style)
return
end
local class = _G[className]
if not class then
error('could not find widget class ' .. class)
return
end
local widget = class.create()
if parent then
parent:addChild(widget)