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.

Recommended Answers

All 5 Replies

A question to Tony:
How did you get the correct address of that post?
I haven't been able to figure that out since Dani changed her format.

@Tony - Thank you!

@vegaseat: You mean to get the address of the post? You copy it from the underlined time of the post with right click - copy link address.

Thanks Tony, that's simple enough!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.