This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author watusimoto
Recipients watusimoto
Date 2021-11-12.21:51:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1636753894.77.0.757469513697.issue45796@roundup.psfhosted.org>
In-reply-to
Content
Attached is a slightly modifed example of the code sample in Bryan Oakley's response to:

https://stackoverflow.com/questions/30337351/how-can-i-ensure-my-ttk-entrys-invalid-state-isnt-cleared-when-it-loses-focus

I have modified it by changing the style.map to change the widget's foreground color (rather than background), and by adding a button below the text input.

Typing a string containing "invalid" into the textbox causes it to fail validation (its state is shown in the bottom label, updated every second).  As expected, the foreground changes to red.

However, if I use [tab] to toggle between the elements, the foreground of the text entry gets changed to black, even if the item is invalid.

Adding         
    style.map("TEntry",  selectforeground=[('invalid', "green")])
creates a new set of weirdness, where the invalid text becomes green when tabbing through the widgets.


I'm running on Windows 10, Python 3.83.
History
Date User Action Args
2021-11-12 21:51:34watusimotosetrecipients: + watusimoto
2021-11-12 21:51:34watusimotosetmessageid: <1636753894.77.0.757469513697.issue45796@roundup.psfhosted.org>
2021-11-12 21:51:34watusimotolinkissue45796 messages
2021-11-12 21:51:34watusimotocreate