I have a script where text is inserted into a scrolledText widget, using Pmw megawidgets. A tag is assigned to the text, and when you click on it, the text is hidden, that is, it changes color to the background color. To unhide it you click it again.
What I want to do, however, is somehow assign a separate tag to each word in the text in an effective way, so that when you click on a word, only that word is hidden and not the entire text. Does anyone know if there is a way to assign a tag to parts of the text by highlighting it, at runtime?
If that isn't possible, I would settle for any method that lets me select the words I want to hide and assign separate tags without doing it 'manually', which is a lot of hassle if the text is long.
Advice would be much appreciated.