Author terry.reedy
Recipients markroseman, ncoghlan, python-dev, serhiy.storchaka, terry.reedy
Date 2015-08-02.09:46:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438508763.52.0.165023505009.issue24759@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-08-02 09:46:03terry.reedysetrecipients: + terry.reedy, ncoghlan, markroseman, python-dev, serhiy.storchaka
2015-08-02 09:46:03terry.reedysetmessageid: <1438508763.52.0.165023505009.issue24759@psf.upfronthosting.co.za>
2015-08-02 09:46:03terry.reedylinkissue24759 messages
2015-08-02 09:46:02terry.reedycreate