Changing label to picture

How can i change the “eraseButton” to a .png picture instead of “label = erase” without ruining
“onRelease = erase” function.
[lua]
local erase = function()
for i = 1, #lineTable do
lineTable[i]:removeSelf()
lineTable[i] = nil
end
return true
end

local eraseButton = widget.newButton{
left = display.contentWidth-125,
top = display.contentHeight - 50,
label = “Erase”,
width = 100, height = 28,
cornerRadius = 8,
onRelease = erase
}

[import]uid: 132369 topic_id: 34048 reply_id: 334048[/import]

Look at the documentation for the widget:

http://docs.coronalabs.com/api/library/widget/newButton.html

The button uses spritesheets for the graphics. I’ve not explored this feature yet, but you can look at the samples in the widget_ios folder in the sample app.

This shouldn’t interfere with the button’s handler functions.
[import]uid: 199310 topic_id: 34048 reply_id: 135387[/import]

Look at the documentation for the widget:

http://docs.coronalabs.com/api/library/widget/newButton.html

The button uses spritesheets for the graphics. I’ve not explored this feature yet, but you can look at the samples in the widget_ios folder in the sample app.

This shouldn’t interfere with the button’s handler functions.
[import]uid: 199310 topic_id: 34048 reply_id: 135387[/import]