New submission from Terry J. Reedy <tjre...@udel.edu>:

Spinoff from #27755, which has a image of tk and ttk versions of a spinbox on 
Mac and asks about using ttk.spinbox.

ttk Spinbox was added to tcl/tk in 8.5.9 and to tkinter.ttk in 3.7. I believe 
there are three cases to consider.
tcl/tk   python  action
>= 8.5.9  >=3.7  from tkinter.tkk import Spinbox
>= 8.5.9   3.6   import Entry and copy class Spinbox(Entry) code
< 8.5.9          from tkinter import Spinbox

Serhiy, is tcl/tk < 8.5.9 something we realistically need to worry about, on 
Linux?

In Dec 2018 or Jan 2019, when 3.6 switches to security fixes only, the 3.6 code 
can be deleted.

For the present, only use config options in the common subset:
cursor, takefocus, validate, validatecommond, invalidcommand,
xscrollcommand, command, to, from_, increment, values, wrap, format.
Is this sufficient?

Whenever we make 8.5.9 or later a requirement, the tkinter Spinbox can be 
dropped and the class and style options used.  Or we can subclass 
tkinter.Spinbox and accept and somehow deal with class and style options.  (We 
are not presently using custom styles.)

For the present, the code can go in query.py, presently only 300 lines.  When 
we only need to cater to 3.7+ and 8.5.9+, the code will be replaced by normal 
import from ttk.

Comman methods: identify, bbox, delete, icursor, index, insert, get.
ttk has set, while tk sets through a textvariable.  If we subclass tk.spinbox, 
it could have a set method that uses a private Var.

 Do the universal widget methods listed on 
http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/universal.html
all apply to ttk widgets?
identify,

----------
assignee: terry.reedy
components: IDLE
messages: 320465
nosy: cheryl.sabella, markroseman, serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: use ttk.spinbox
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33962>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to