1

I realised that the ttk.Spinbox always seems to highlight the new value that got chosen via up or down button. Is there a way to avoid this functionality? It's possible to set selectbackground=<background color>, selectforeground=<foreground color> in Style but that just hides the problem.

  • OS: Windows 10 Home
  • Tcl/Tk: 8.6
  • Python: 3.7.3

Reproducable example:

from tkinter import Tk
from tkinter.ttk import Spinbox, Style

root = Tk()
spinbox = Spinbox(root, from_=0, to=10)
spinbox.pack(expand=True)

### How to hide it
style = Style(root)
style.configure('TSpinbox',
                selectbackground=style.configure('TSpinbox', 'background'), #set selectforeground to foreground
                selectforeground=style.configure('TSpinbox', 'foreground')) #set selectbackground to background
###

root.mainloop()
Nummer_42O
  • 334
  • 2
  • 16

0 Answers0