Mailing List Archive

[issue33962] IDLE: use ttk.spinbox with configdialog
Change by Mark Roseman <mark@markroseman.com>:


----------
keywords: +patch
pull_requests: +21872
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/22954

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue33962>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue33962] IDLE: use ttk.spinbox with configdialog [ In reply to ]
Terry J. Reedy <tjreedy@udel.edu> added the comment:

#27755 was about replacing uses of our custom DynOptionMenu with ttk.Combobox, which I believe we can do now, wherever we don't replace it with something else. One use is for font size choice; Spinbox was suggested as an alternative replacement.

Spinbox was also proposed somewhere else to remplace the indent size Label scale. But I/we had decided, somewhere, to use a simple entry box, like those for entering counts on the General tab, with validation limits of 1 and 16, and move the choice to the General tab. (If we don't have validate(min, max) function, should make one.) SO

The transfer cannot be done until the General tab is split into 2, as it is now too long (does not fix on Macbook Air -- cannot see buttons). I think General windows preferences (where indent should go) + help resources for 1, Specific Editor only or Shell only for other. Not sure of names.

This all said, I tried out the patch. The spinbox appears to be an Entry with added arrows. If it worked right, it could be used for some other int entries instead of plain Entry. But in some ways, it seems partly worse than Entry.
0. No doc in Shipman (written before 8.5.9); must use tk doc.
1. Expands to space available; is Entry char width really disabled?
2. Deleting digit to replace it generates 2 TclErrors*.
3. Clicking arrow 'selects' entry. Patch used text selection, but my dark theme select looks awful for single digit. We can fix this with different config.

* ...
File "f:\dev\3x\lib\tkinter\__init__.py", line 536, in get
return self._tk.getint(value)
_tkinter.TclError: expected integer but got ""
During handling of the above exception, another exception occurred:
...
File "f:\dev\3x\lib\tkinter\__init__.py", line 538, in get
return int(self._tk.getdouble(value))
_tkinter.TclError: expected floating-point number but got ""

I will look more later.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue33962>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue33962] IDLE: use ttk.spinbox with configdialog [ In reply to ]
Mark Roseman <mark@markroseman.com> added the comment:

Whoops, sorry... there's a "readonly" state flag that disables direct editing of the entry (like with combobox) and just allows manipulation of the arrows. I've updated the PR to set that. I've also changed it so that the contents of the entry part isn't selected whenever the arrows are used (agreed, it looks ugly). Please give it a try and let me know.

p.s. I just checked, the entry's width configuration option works. You just have to remove the "fill=X" when the widget is packed. FWIW, I kept the previous layout to keep the patch as minimal as possible, under the assumption that other layout changes (here, on in general) were planned.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue33962>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue33962] IDLE: use ttk.spinbox with configdialog [ In reply to ]
Mark Roseman <mark@markroseman.com> added the comment:

Just as a side note for Terry and anyone else testing on macOS... the recent updates in Tk have smoothed out many of the appearance issues for the classic widgets. See the attached screen shot tkversions.png comparing 8.6.9 with the current trunk of the Tk repo. Notice things like the background color around the optionmenu aren't as jarring on the newer Tk versions.

Having said that, I'll likely stick with the older ones for development purposes, just because the blemishes with the classic widgets and other things are so much more noticeable!

Incidentally, if you've got several versions of Tcl/Tk on your system, you can use /usr/bin/install_name_tool to point the Tkinter shared library at the one you want to use. Use like "install_name_tool -change OLD NEW file", e.g.:
install_name_tool -change /Library/Frameworks/Tk.framework/Versions/8.6/Tk /Users/roseman/tmp/tcl86core/Library/Frameworks/Tk.framework/Versions/8.6/Tk build/lib.macosx-10.15-x86_64-3.10/_tkinter.cpython-310-darwin.so

----------
Added file: https://bugs.python.org/file49540/tkversions.png

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