Page 1 of 1

Is it possible to use self in evt_table functions?

Posted: Tue Jul 18, 2017 6:04 am
by Bugala
This isnt the only situation where I have encountered this problem, but just as example.

Suppose I am making a button, so i make:

Code: Select all

makebutton(1, #LAYERBUTTON, "brushname", false, false, evt_table)
Problem is the evt_table part.

Suppose i have a function:

Code: Select all

function myfunc:changeX
self.x = mousex()
endfunction 
but now when i try to use it on evt_table:

Code: Select all

evt_table={OnMouseDown = myfunc:changeX}
it doesnt work.

Is there a way to access a self function in situation like this, or am i forced to not use self in situations like this?

Re: Is it possible to use self in evt_table functions?

Posted: Sat Jul 22, 2017 2:28 pm
by airsoftsoftwair
I'm afraid but that isn't supported at the moment. You can emulate it using the userdata parameter, though.

Re: Is it possible to use self in evt_table functions?

Posted: Sat Jul 22, 2017 4:23 pm
by Bugala
to wish list then.