Yiv 321 Posted October 4, 2014 Share Posted October 4, 2014 Dear community, I'd like to know if someone could tell me how to call a function over ui.__mem_func__ (used in e.g. mouse over) with parameters? So if I have the function funcWithParams(self, par1, par2) and I know want to call it with ui.__mem_func__(self.funcWithParams) I want to give some parameters. I already tried this: ui.__mem_func__(self.funcWithParams, 1, 2) ui.__mem_func__(self.funcWithParams(1, 2)) ui.__mem_func__(self.funcWithParams, (1, 2)) Nothing works (except my workaround which is not really good!). Someone knows a solution? Regards 1 Link to comment Share on other sites More sharing options...
ѕeмa™ 308 Posted October 4, 2014 Share Posted October 4, 2014 try: self.button.SetEvent( lambda x = argument : self.funcwithparams(x)) def funcwithparams(self, argument): https://m2admin.net/ Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19762 Posted October 4, 2014 Honorable Member Share Posted October 4, 2014 btn.SetEvent(ui.__mem_func__(self.__ShowAnimation), ani)#one parameter btn.SetEvent(ui.__mem_func__(self.__ShowAnimation), arg1, arg2, arg3)# more parameter Link to comment Share on other sites More sharing options...
Yiv 321 Posted October 4, 2014 Author Share Posted October 4, 2014 Well, buttons are no problems and I didn't speak about them I said something like mouse over E.g. in the inventory SetOverInItemEvent for tooltips. Thanks anyway! Other? Regards 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now