This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年10月14日 15:52 by roger.serwy, last changed 2022年04月11日 14:57 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| patch_EditorWindow.diff | roger.serwy, 2011年10月14日 15:52 | |||
| Messages (4) | |||
|---|---|---|---|
| msg145539 - (view) | Author: Roger Serwy (roger.serwy) * (Python committer) | Date: 2011年10月14日 15:52 | |
IDLE's EditorWindow.py relies on using FileList.py's "vars" dictionary to store Tkinter variables instead of using its own. As a consequence,
toggling a checked menu item in one editor window toggles the menu item in ALL editor windows.
To reproduce this error, open two editor windows with Code Context initially disabled. Enable Code Context in one window and then click "Options" in the other. You'll see Code Context checked when it shouldn't be.
Attached is a patch to fix this problem. It causes EditorWindow to have its own dictionary for handling these Tkinter variables instead of using the flist's "vars". The comment in FileList.py suggests that this design is a relic from an old version of IDLE, since getrawvar is no longer a function.
self.vars = {} # For EditorWindow.getrawvar (shared Tcl variables)
|
|||
| msg145578 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2011年10月15日 01:12 | |
This is more of a feature request than a bug report, in that the behavior appear intentional. But that is a moot point in that new IDLE features do not have to wait for a new release. The proposed new behavior seems plausibly better. I just wonder if anything in flist.vars *should* carry over (maybe as a copy) to all edit windows, but I do not know its contents. Also, I can imagine that someone who knows about (I did not before) and likes the 'code context' option (I might start using it) would want it to be always on once turned on. That suggests that it should be added to the configure dialog before being made local with this patch. I might feel the same about at least some of the other vars also. |
|||
| msg145601 - (view) | Author: Roger Serwy (roger.serwy) * (Python committer) | Date: 2011年10月15日 17:03 | |
For Code Context, the behavior is a bug since the menu item check can be changed independently of the actual status of Code Context. As far as I can tell, flist.vars mostly contains variables created by EditorWindow.py's "get_var_obj". A quick grep for ".vars" in idlelib can confirm that. It also contains variables created by PyShell.py, particularly '<<toggle-jit-stack-viewer>>' and '<<toggle-debugger>>'. Since the shell can only have one instance, its tkinter variables can be held local to the EditorWindow instance. |
|||
| msg226373 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年09月04日 19:18 | |
There has been more discussion of code context toggling in #17535, msg225411 2014年8月16日 and following messages. The code context button toggles both the state of the current window and the default for new windows. PEP 434 ratified my comment about new Idle features not having to wait. #3068 is about adding an extension configuration dialog that will be needed to uncouple the local and global effects of option buttons for extension features. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:22 | admin | set | github: 57388 |
| 2020年06月09日 04:09:03 | terry.reedy | set | versions: + Python 3.10, - Python 3.6, Python 3.7 |
| 2017年06月30日 00:54:19 | terry.reedy | set | assignee: terry.reedy stage: patch review versions: + Python 3.6, Python 3.7, - Python 2.7, Python 3.4, Python 3.5 |
| 2014年09月04日 19:18:56 | terry.reedy | set | messages:
+ msg226373 versions: + Python 3.5, - Python 3.3 |
| 2013年06月15日 18:43:08 | terry.reedy | set | versions: + Python 3.4, - Python 3.2 |
| 2011年10月15日 17:03:44 | roger.serwy | set | messages: + msg145601 |
| 2011年10月15日 01:12:37 | terry.reedy | set | versions:
+ Python 3.3, - Python 2.6, Python 3.1 nosy: + terry.reedy messages: + msg145578 type: behavior -> enhancement |
| 2011年10月14日 15:52:27 | roger.serwy | create | |