I’m trying to make a text entry with a gray hint in it that goes black when someone enters text into it. had already made a similar question but more broadly to try to get there by me, but not served as much. But anyway, it can help other problems.
My other question:
Gtk python entry color
There are different parts to this solution. Firstly the coloring is handling by the css which colors the text grey when the entry box is not focused and then black as it gains focus. The second part is up to you if you wish to implement which is that you might want to clear the grey text in the box as the text box gets focus. For convenience I have put focus in and out event handlers that currently just print to the terminal.
code
style.css
screenshot