I am somewhat new to python still, and am working on a project including a GUI. I using with Tkinter and buttons a lot, and am curious if there was a way to run a function with a bind because I want one thing to happen when it is presses and something else when it is released.
s = str(x+1) + ":" + str(y+1)
img = ImageTk.PhotoImage(Image.open('button.png'))
b = Tkinter.Button(field_hid, image=img, borderwidth=0, highlightthickness=0, background='grey')
b.bind("<ButtonPress-1>", lambda s=s, button=b: location_down(event,s,button))
b.bind("<ButtonRelease-1>", lambda s=s, button=b: location_up(event,s,button))
b.img = img
b.pack()
b.grid(row=x, column=y)
I don't understand how I am to do this, as the only thing that can be passed to the function is the event, but my program requires the arguments.