[issue24759] Idle: add ttk widgets as an option
Nick Coghlan added the comment: IDLE's in an interesting place right now - it isn't showing people Tcl/Tk in its best light, so folks are likely to assume all Tcl/Tk apps necessarily look that way, and it's also using GUI idioms like separate shell and editor windows that don't reflect the conventions of modern IDEs. For 3.5.1+, I think there's no question that we want to show IDLE in the best possible light, and we want to try to do that by default. That means modernising it to use the best cross-platform features that Tcl/Tk has to offer (including ttk). However, Ned pointed out that the last PPC-supporting Mac OS X (10.5) has a Tcl/Tk version older than 8.5, and there's the general compatibility risk for breaking extensions with large refactorings, so retaining a non-ttk mode will be a valuable approach to the modernisation effort. -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24759 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24759] Idle: add ttk widgets as an option
Terry J. Reedy added the comment: A second specific reason to make ttk optional is either they or the accompanying re-writing may (and probably will) break some extension that goes beyond the narrowly defined extension interface. For the present, a user using such an extension would be able to continue to do so, by turning use_ttk off. (I plan to add some DeprecationWarnings, either at startup or old tk module import, when use_ttk is possible but turned off.) The normal bugfix-only policy, and the Idle exemption, starts with each x.y.0b1 release. The point of excluding 'major re-writes such as switching to themed widgets' was to exclude changes in bugfix releases that prevent idle from running in the 'current' environment. In private email, Nick agreed with me that with ttk and any possible disablement made optional, it can be added to all current releases. He also suggested being on by default when possible. I decided not to put anything into 3.5.0. I intend to start pushing ttk patches perhaps next week after the release branch is split off and the main 3.5 branch is 3.5.1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24759 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24759] Idle: add ttk widgets as an option
Roundup Robot added the comment: New changeset 0511b1165bb6 by Terry Jan Reedy in branch '2.7': Issue #24759: Revert 8203fc75b3d2. https://hg.python.org/cpython/rev/0511b1165bb6 New changeset 06852194f541 by Terry Jan Reedy in branch '3.4': Issue #24759: Revert 13a8782a775e. https://hg.python.org/cpython/rev/06852194f541 New changeset 863e3cdbbabe by Terry Jan Reedy in branch '3.5': Issue #24759: Merge with 3.4 https://hg.python.org/cpython/rev/863e3cdbbabe New changeset 3bcb184b62f8 by Terry Jan Reedy in branch 'default': Issue #24759: Merge with 3.5 https://hg.python.org/cpython/rev/3bcb184b62f8 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24759 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24759] Idle: add ttk widgets as an option
Serhiy Storchaka added the comment: Note also that committed patch doesn't work at all. from tkinter import ttk doesn't raise an exception with Tcl/Tk 8.4. See my patch in issue24750 that does working check. I consider impractical complex code for supporting 8.4 and ttk too. But in simplest cases this can be done easy. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24759 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24759] Idle: add ttk widgets as an option
Terry J. Reedy added the comment: If 2.7 and 3.4 are left out of consideration, then, AFAIK, the only people necessarily affected are those with a PowerPC with OS 10.5 who upgrade to python3.5 and also want to run Idle. People with an Intel machine instead might be if there is no python3.5 that will run with the ActiveState 8.5 that Mark says works on Intel 10.5 machines. I wish I know how many people that is. I suspect a tiny fraction of Idle users and of people with such machines. But ... The compatibility approach will work for Scrollbars, but I am dubious about other widgets. For instance, tk Buttons have at least 31 options. ttk Buttons have 9 of the same + style (and class_, which I do not thing we would use), leaving 22 tk-only options. To write tkttk code *in one file*, I believe ...ttk.Button(parent, options, style='xyz') would have to be written (compactly) as something like b=...Button(parent, common options) b.config(**({'style':'xyz'} if ttk else { tk style options})) or (expansively, in 5 lines) b=...Button(parent, common options) if ttk: b['style'] = 'xyz' else: b.config(tk style options in '=' format}) I consider this impractical. I am unwilling to write code that way, in part because it would have to be carefully tested both with and without ttk -- by hand. I cannot imagine anyone else doing so either. It also does not work for uses of ttk.Treeview, whose API is different from the multiple classes used in Path and Class (Module) browser). I believe the same is true for ttk.Notebook and the idlelib tab widget. What I already planned to do instead is copy existing dialog code to new files, possibly refactored, with pep8 filenames and internal names style. I already planned to leave the existing files in place for now, though as zombies, in case of any external code imports. With a little more work, it should be possible to optionally use either old or new files. Most of the work would be done with alternate bindings to menu items and accelerator keys, such as Find in Files and Alt-F3. It might be more acceptible to use ttk in 2.7 and 3.4 as an option rather than as a replacement. Though I would only commit a ttk version when confident that is works, leaving the option to switch back would add a safety factor. I changed the title and will revert the patch later. -- stage: - needs patch title: Idle: require ttk (and tcl/tk 8.5) - Idle: add ttk widgets as an option ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24759 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24759] Idle: add ttk widgets as an option
Terry J. Reedy added the comment: I realize now that tkinter.ttk is (normally) present and will define Python classes even if the tk widgets needed for them to work are not present. More comments on the added module on #24750 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24759 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com