i have some tags in a text widget and bound a click function to all of them.
My example sentence is "my cute, little cat". "Cute" and "little" are the tagged words with the tag adj.
In this click function i can not figure out the way to get the string i clicked. When i click on cute i want to print cute to the console.
This is what i have so far, i did not include how i apply the tag, since this works. The click function is called correctly.
def __init__(self, master):
# skipped some stuff here
self.MT.tag_config('adj', foreground='orange')
# here i bind the click function
self.MT.tag_bind('adj', '<Button-1>', self.click)
def click(self, event):
print(dir(event))
# i want to print the clicked tag text here
Is there a way to do this?
Best, Michael