Reputation: 381
I would like to know if theres a way to get all the items in the canvas that contain the tags. As far as I know the function canvas.find_withtag(tag)
only allows for one tag and I would like to be able to do: canvas.find_withtag(tag0, tag1, ...)
. Basically is there a clean way to get the items that match more than one tag without having to play with sets. Is there a clean way or will I have to do the logic myself using canvas.find_withtag(tag)?
What Im actually asking is if theres is a better way to accomplish this:
itemstag1 = set(self.v_maps.canvas.find_withtag(tag1))
itemstag2 = set(self.v_maps.canvas.find_withtag(tag2))
for item in itemstag1 &itemstag2:
self.canvas.itemconfig(item, fill=color)
Upvotes: 0
Views: 1219