Hello,
I was wondering if its possible to pass a variable to the callback function of the OnClickedListener. I have an array with buttons and they all need to do something else based on a value I have when setting the listener.
right now the x and y are passed to the callback function.
ac.addOnClickedListener(buttons[carId],btnClickEvent)
def btnClickEvent(x,y):
ac.console(str(carId))
But I would like to add a 3th parameter:
def btnClickEvent(x,y,carId):
Is there any way to do this?
I was wondering if its possible to pass a variable to the callback function of the OnClickedListener. I have an array with buttons and they all need to do something else based on a value I have when setting the listener.
right now the x and y are passed to the callback function.
ac.addOnClickedListener(buttons[carId],btnClickEvent)
def btnClickEvent(x,y):
ac.console(str(carId))
But I would like to add a 3th parameter:
def btnClickEvent(x,y,carId):
Is there any way to do this?