improvment in connect

This commit is contained in:
Eduardo Bart
2012-02-08 20:58:27 -02:00
parent 175f97b98f
commit 55fbb5f1a6
9 changed files with 26 additions and 19 deletions

View File

@@ -44,7 +44,7 @@ function ToolTip.init()
toolTipLabel = createWidget('Label', rootWidget)
toolTipLabel:setId('toolTip')
toolTipLabel:setBackgroundColor('#111111bb')
connect(toolTipLabel, { onMouseMove = moveToolTip })
toolTipLabel.onMouseMove = moveToolTip
connect(UIWidget, { onStyleApply = onWidgetStyleApply,
onHoverChange = onWidgetHoverChange})

View File

@@ -30,9 +30,9 @@ end
function UIPopupMenu:addOption(optionName, optionCallback)
local optionWidget = createWidget(self:getStyleName() .. 'Button', self)
local lastOptionWidget = self:getLastChild()
optionWidget.onClick = function()
optionWidget.onClick = function(self)
optionCallback()
self:destroy()
self:getParent():destroy()
end
optionWidget:setText(optionName)
local width = optionWidget:getTextSize().width + optionWidget:getMarginLeft() + optionWidget:getMarginRight() + 6