Right now I'm having trouble event binding an array of canvases.
You see I want to create an array of canvases binding with double click, these binds call a function that take in an argument.
my code is similar as follows
however python tells me that I'm trying to pass in an instance of an object rather than a string(the function changedir concates a string and the given argument)
Can anybody tell me what I'm doing wrong?
You see I want to create an array of canvases binding with double click, these binds call a function that take in an argument.
my code is similar as follows
Code:
for dir in listofdir:
thumbnail = Canvas(Master)
thumbnail.bind("<Double-Button-1>",lambda x=dir: changedir(x))
thumbnail.pack()
Can anybody tell me what I'm doing wrong?
Comment