Skip to content

bpo-30853: IDLE: Convert font and general vars to use VarTrace #2914

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

Merged
merged 3 commits into from
Jul 28, 2017

Conversation

csabella
Copy link
Contributor

@csabella csabella commented Jul 27, 2017


if not _utest:
self.grab_set()
self.wm_deiconify()
self.wait_window()


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class method only need one blank line, so this is no need to changed.

Copy link
Contributor Author

@csabella csabella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Global makes more sense.

self.builtin_theme = tracers.add(
StringVar(parent), self.var_changed_builtin_theme)
self.custom_theme = tracers.add(
StringVar(parent), self.var_changed_custom_theme)
self.fg_bg_toggle = BooleanVar(parent)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is now obvious that fg_bg_toggle is not traced, others are. A plus for the change.

@@ -75,13 +76,15 @@ def __init__(self, parent, title='', _htest=False, _utest=False):
# self.bind('<Alt-a>', self.Apply) #apply changes, save
# self.bind('<F1>', self.Help) #context help
self.load_configs()
self.attach_var_callbacks() # Avoid callbacks during load_configs.
# Avoid callbacks during load_configs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must remember this when reviewing and writing tests for the load functions.

@terryjreedy terryjreedy merged commit 5b59154 into python:master Jul 28, 2017
terryjreedy pushed a commit to terryjreedy/cpython that referenced this pull request Jul 28, 2017
…ythonGH-2914)

Instance tracers manages pairs consisting of a tk variable and a
callback function.  When tracing is turned on, setting the variable
calls the function.  Test coverage for the new class is 100%.
(cherry picked from commit 5b59154)
@csabella csabella deleted the bpo30853 branch July 28, 2017 19:33
terryjreedy added a commit that referenced this pull request Jul 28, 2017
…H-2914) (#2935)

Instance tracers manages pairs consisting of a tk variable and a
callback function.  When tracing is turned on, setting the variable
calls the function.  Test coverage for the new class is 100%.
(cherry picked from commit 5b59154)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants