seriously? :blink:
the first example on the documentation page i provided goes like this:
local widget = require( "widget" ) -- Function to handle button events local function handleButtonEvent( event ) if ( "ended" == event.phase ) then print( "Button was pressed and released" ) end end -- Create the widget local button1 = widget.newButton( { left = 100, top = 200, id = "button1", label = "Default", onEvent = handleButtonEvent } )
by adding a single line (let me know if you cant find it), i get the id from the button passed to the function like this:
local widget = require( "widget" ) -- Function to handle button events local function handleButtonEvent( event ) if ( "ended" == event.phase ) then print( "Button was pressed and released" ) print(event.target.id) end end -- Create the widget local button1 = widget.newButton( { left = 100, top = 200, id = "button1", label = "Default", onEvent = handleButtonEvent } )
this is fundamental lua and corona behaviour, something you’d know if you’d actually read the documentation instead of embarking on this pissing contest.
and for the record, my RTFM comment was not my first reply post but my second post after reading your less than lovely reply to my first post.