New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
turtledemo does not work with IDLE's new dark theme. #71304
Comments
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. |
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. |
New changeset c95864a37ee2 by Terry Jan Reedy in branch 'default': New changeset f383eaf207ca by Terry Jan Reedy in branch '3.5': |
Heads are not merged. |
New changeset 169551a8d5d1 by Martin Panter in branch 'default': |
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?) |
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). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: