You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Idle: Enhance font change notification system #65116
If one changes the font in the Idle Preferences dialog, all open windows are somehow notified and they immediately respond. Classes defined in extensions do not get notified. So CodeContext sets up a polling loop. Roger Serwy's line number extension (posted to bpo-17535) copied the polling hack. It would be better to enhance the the notification mechanism to either generate an event that could be caught or setup a callback registry.
Changing CodeContext.py to drop the font polling and use the new mechanism is part of this issue. Such a change would effectively be part of its test.
roseman commented on Sep 12, 2015
rosemanmannequin
Mannequin
More actions
The new 'component' infrastructure provides the mechanism for passing these kinds of notifications around. Allowing extensions (in whatever form they'll exist with the new stuff) to take part in this notification mechanism would be a small (and sensible) addition to that.
I believe I saw somewhere that the 'somehow' in the opening post is looping through the windows listed under the Window tab.
This issue was inspired by bpo-17642, which allows hotkeys (^-, ^+) and wheel to change font size in editor window. If the size change only applies to the current window, then only the CodeContext for that window should be notified. If CodeContext becomes a feature rather than extension, bpo-27099, then code editor windows could know they have a code context and notify it when they get notified. That will not help external extensions.
Activity
terryjreedy commentedon Mar 13, 2014
If one changes the font in the Idle Preferences dialog, all open windows are somehow notified and they immediately respond. Classes defined in extensions do not get notified. So CodeContext sets up a polling loop. Roger Serwy's line number extension (posted to bpo-17535) copied the polling hack. It would be better to enhance the the notification mechanism to either generate an event that could be caught or setup a callback registry.
terryjreedy commentedon Mar 13, 2014
Changing CodeContext.py to drop the font polling and use the new mechanism is part of this issue. Such a change would effectively be part of its test.
roseman commentedon Sep 12, 2015
The new 'component' infrastructure provides the mechanism for passing these kinds of notifications around. Allowing extensions (in whatever form they'll exist with the new stuff) to take part in this notification mechanism would be a small (and sensible) addition to that.
terryjreedy commentedon Jul 10, 2017
I believe I saw somewhere that the 'somehow' in the opening post is looping through the windows listed under the Window tab.
This issue was inspired by bpo-17642, which allows hotkeys (^-, ^+) and wheel to change font size in editor window. If the size change only applies to the current window, then only the CodeContext for that window should be notified. If CodeContext becomes a feature rather than extension, bpo-27099, then code editor windows could know they have a code context and notify it when they get notified. That will not help external extensions.