classification
Title: turtledemo does not work with IDLE's new dark theme.
Type: behavior Stage: resolved
Components: Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: martin.panter, python-dev, serhiy.storchaka, terry.reedy
Priority: normal Keywords:

Created on 2016-05-25 03:02 by terry.reedy, last changed 2018-09-23 03:37 by taleinat. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9008 taleinat, 2018-09-23 03:37
Messages (7)
msg266293 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-05-25 03:02
turtledemo imports IDLE's Percolator, ColorDelegator, and read-only text viewer and uses the first two to colorize demo text it loads into the text viewer.  This works fine for traditional dark on white text color themes but not for IDLE's new white, etc, on dark theme (IDLE Dark).  The reason is that the text viewer was designed to display black on white text, not colorized  code.  IDLE's editor tells tk how to display normal text.  The text view does not, so normal text is the default black on white.  The result is that special items are color on 'black' (dark blue actually) while normal text is black on white.  The strange result can be viewed by selecting IDLE Dark in the preferences dialog and then selecting Help - Turtledemo or running 'python -m turtledemo' in a console.

The immediate workaround is for anyone running turtledemo to use a normal color theme, at least temporarily.  A longer-term solution might be to add a startup option to the text viewer to use the 'normal text' colors of the current theme.
msg266584 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-05-29 05:36
I was wrong about turtledemo's text pane.  Turtledemo only uses textview for help.  The text frame contains a plain Text widget.  I moved the text color-config code from editor to a function in colorizer, where it is also needed for the colorizer test.
msg266585 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-05-29 05:42
New changeset c95864a37ee2 by Terry Jan Reedy in branch 'default':
Issue #27117: Make colorizer htest and turtledemo work with dark theme.
https://hg.python.org/cpython/rev/c95864a37ee2

New changeset f383eaf207ca by Terry Jan Reedy in branch '3.5':
Issue #27117: Make ColorDelegator htest and turtledemo work with dark theme.
https://hg.python.org/cpython/rev/f383eaf207ca
msg266589 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-05-29 07:04
Heads are not merged.
msg266594 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-05-29 09:09
New changeset 169551a8d5d1 by Martin Panter in branch 'default':
Issue #27125: Merge typo fixes from 3.5
https://hg.python.org/cpython/rev/169551a8d5d1
msg266596 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-05-29 09:13
It looks like your commit to the “default” branch already included the relevant changes, so I did the merge while keeping the files the same. If I missed something, it may need an extra update. But the tests seem to be working (is there a turtledemo test?)
msg266603 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-05-29 17:25
I prepared and tested two slightly different patches for 3.5 and 3.6.  I committed the 3.6 patch, then the 3.5 patch, and prepared a null merge (in default), but did not hit the commit button before pushing.  I just finished the null merge, creating two heads (in default), which I merged (after updating to Martin's head) and pushed both.  Everything looks good here after re-pulling.  One of you could recheck in your clones.
---

turtledemo.__main__ creates a framework for running any of the demo files in the package.  There is no test_turtledemo unittest.  The test is to run it, either with python -m turtledemo in the console or Help => Turtle Demo in IDLE.  Two summers ago, before adding the IDLE menu item, I loaded and ran each of the demos, patched a few, as well as .__main__, and re-ran, more than once.

For this issue, I only needed to load one demo with the IDLE Dark theme, or a custom version thereof, as the current theme.  If someone has not customized the theme selection in IDLE, the default IDLE Classic, black on white, will be used.

Testing this issue also required running IDLE and loading a file to be sure the the revised editor still worked, and loading and running the colorizer file, to run its htest (which previously had the same problem as turtledemo).
History
Date User Action Args
2018-09-23 03:37:19taleinatsetpull_requests: + pull_request8908
2016-05-29 17:25:51terry.reedysetmessages: + msg266603
2016-05-29 09:13:14martin.pantersetnosy: + martin.panter
messages: + msg266596
2016-05-29 09:09:16python-devsetmessages: + msg266594
2016-05-29 07:04:21serhiy.storchakasetmessages: + msg266589
2016-05-29 05:44:08terry.reedysetstatus: open -> closed
resolution: fixed
stage: test needed -> resolved
2016-05-29 05:42:26python-devsetnosy: + python-dev
messages: + msg266585
2016-05-29 05:36:13terry.reedysetassignee: terry.reedy
messages: + msg266584
2016-05-25 03:51:21serhiy.storchakasetnosy: + serhiy.storchaka
2016-05-25 03:02:19terry.reedycreate