I’ve made a 9-Slice button following the docs (http://docs.coronalabs.com/api/library/widget/newButton.html). The button works fine, but I can’t figure out where to add the function that it needs to execute. What do I miss?
--image sheet options and declaration local options = { frames = { { x= 0, y=0, width=21, height=21 }, { x= 21, y=0, width=198, height=21 }, { x= 219, y=0, width=21, height=21 }, { x= 0, y=21, width=21, height=78 }, { x= 021, y=21, width=198, height=78 }, { x= 219, y=21, width=21, height=78 }, { x= 000, y=99, width=21, height=21 }, { x= 021, y=99, width=198, height=21 }, { x= 219, y=99, width=21, height=21 }, { x=240, y=0, width=21, height=21 }, { x=261, y=0, width=198, height=21 }, { x=459, y=0, width=21, height=21 }, { x=240, y=21, width=21, height=78 }, { x=261, y=21, width=198, height=78 }, { x=459, y=21, width=21, height=78 }, { x=240, y=99, width=21, height=21 }, { x=261, y=99, width=198, height=21 }, { x=459, y=99, width=21, height=21 } }, sheetContentWidth = 480, sheetContentHeight = 120 } local buttonSheet = graphics.newImageSheet( "buttonSheet.png", options ) buttonA = widget.newButton { width = botaoLargura, --flexible width of the 9-slice button height = botaoAltura, --flexible height of the 9-slice button sheet = buttonSheet, --reference to the image sheet topLeftFrame = 1, --number of the "top left" frame topMiddleFrame = 2, --number of the "top middle" frame topRightFrame = 3, --etc. middleLeftFrame = 4, middleFrame = 5, middleRightFrame = 6, bottomLeftFrame = 7, bottomMiddleFrame = 8, bottomRightFrame = 9, topLeftOverFrame = 10, topMiddleOverFrame = 11, topRightOverFrame = 12, middleLeftOverFrame = 13, middleOverFrame = 14, middleRightOverFrame = 15, bottomLeftOverFrame = 16, bottomMiddleOverFrame = 17, bottomRightOverFrame = 18, label = "button", font = native.systemFont, labelColor = { default = { 255, 255, 255 }, over = { 0, 0, 0} }, fontSize = 40 } buttonA:setLabel("+") end