I have following function:
def button_enter(self, event, type):
if self.green_button_anim_on:
return
self.canvas.itemconfigure(self.green_button, image=self.green_button_image_hover)
This functions serves for the change of image of green button to "hover state" image when user hovers mouse over it.
What I am trying to do - I want to use this function universally, not just for the green button, but also for the red button, quit button etc. So I decided to pass the argument type to the function that will have values like red, green, quit etc.
Now I need to change the word green everywhere inside this function according to the value of argument type. What is the easiest way to do it please? Thank you!