mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
auto resize menu width
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user