Widget Function

I have a widget button with a function to be called when the user releases the button. I am trying to figure out how to get access to the label of the widget that calls the function… Cant figure out the syntax… So for instance

local function foo()

print( How do I access the “Hey Good Looking” text from here) – ??

end

newButton = widget.newButton{

label = “Hey Good Looking”,

onRelease = foo,

}

foo() will have an event argument, and you can grab the button out of that and ask its label:

local function foo (event) print(event.target:getLabel()) end

Nice, thanks!

foo() will have an event argument, and you can grab the button out of that and ask its label:

local function foo (event) print(event.target:getLabel()) end

Nice, thanks!