Well i want to pass data through a widget. Something like this.
local function showImg( event, \_fileName) print(\_fileName) end local button = widget.newButton { x = , y = , width = , height = , defaultFile = "imgs.png", onEvent = showImg( event, defualtFile ) }
But right now i can only do
local function showImg() print() end local button = widget.newButton { x = , y = , width = , height = , defaultFile = "imgs.png", onEvent = showImg }
So my problem is that I have a widget button and when i press it i need that function to see what the file name of that widget is. How would i do this? Would i need to make make my own widget button like thing so i can get that data over to the function?
I found this thread. Not sure if this can and how apply to my problem.
https://forums.coronalabs.com/topic/50659-passing-information-through-onrelease-newwidgetbutton/
Or maybe one of you has there own button library that you wont mind sharing?
–SonicX278