Skip to content
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

Closed
terryjreedy opened this issue May 25, 2016 · 7 comments
Closed

turtledemo does not work with IDLE's new dark theme. #71304

terryjreedy opened this issue May 25, 2016 · 7 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@terryjreedy
Copy link
Member

BPO 27117
Nosy @terryjreedy, @vadmium, @serhiy-storchaka
PRs
  • bpo-34548: IDLE: use configured theme colors in TextView #9008
  • 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:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2016-05-29.05:44:08.279>
    created_at = <Date 2016-05-25.03:02:19.687>
    labels = ['type-bug']
    title = "turtledemo does not work with IDLE's new dark theme."
    updated_at = <Date 2018-09-23.03:37:19.009>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2018-09-23.03:37:19.009>
    actor = 'taleinat'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2016-05-29.05:44:08.279>
    closer = 'terry.reedy'
    components = []
    creation = <Date 2016-05-25.03:02:19.687>
    creator = 'terry.reedy'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 27117
    keywords = []
    message_count = 7.0
    messages = ['266293', '266584', '266585', '266589', '266594', '266596', '266603']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'python-dev', 'martin.panter', 'serhiy.storchaka']
    pr_nums = ['9008']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue27117'
    versions = ['Python 3.5', 'Python 3.6']

    @terryjreedy
    Copy link
    Member Author

    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.

    @terryjreedy terryjreedy added the type-bug An unexpected behavior, bug, or error label May 25, 2016
    @terryjreedy
    Copy link
    Member Author

    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.

    @terryjreedy terryjreedy self-assigned this May 29, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 29, 2016

    New changeset c95864a37ee2 by Terry Jan Reedy in branch 'default':
    Issue bpo-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 bpo-27117: Make ColorDelegator htest and turtledemo work with dark theme.
    https://hg.python.org/cpython/rev/f383eaf207ca

    @serhiy-storchaka
    Copy link
    Member

    Heads are not merged.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 29, 2016

    New changeset 169551a8d5d1 by Martin Panter in branch 'default':
    Issue bpo-27125: Merge typo fixes from 3.5
    https://hg.python.org/cpython/rev/169551a8d5d1

    @vadmium
    Copy link
    Member

    vadmium commented May 29, 2016

    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?)

    @terryjreedy
    Copy link
    Member Author

    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).

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants