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 tk&ttk 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

Reply via email to