What I`m using: Tkinter
What I want: to create a text with keywords that will be highlighted when the cursor hovers over them, and to execute the function bound to them when you click on it. In the future I plan to bind additional information to these words
How it looks for me for now: the closest thing I've found is how to call functions when hovering over and clicking on text in a Label
using bind()
function (like bind("<Enter>", red_text)
). But this way I have no way to change one specific word. In addition, if it turns out that the only way to do what I want is to create individual Labels
for each of the sentences and keywords, and then posit them as well, then I'm not sure how to make it simpler
For what I need it and what I expect to see: I want to be able to write fiction text, in which later, will be identified keywords. These keywords, when activated, will offer pre-created answer options for them
A bit more illustrative example:
Text: Hello, world!
, where the main text is displayed like non-bold and italic, and keyword the opposite - bold and non-italic. Fonts is white
Keyword: "world" - bound with functions that change and return the original color (depending on whether the cursor points to it) and a more complex function, when clicked, that offers answer choices in a separate window (which initially contains the standard answers)
Answer options before pressing the keyword:
1. Hi!
And after:
1. What world?
2. The world is me?
3. Who are you talking to?