Skip to content

tkinter.Spinbox seems to not work when 'value' parameter is set. #102588

@ThePython10110

Description

@ThePython10110

Bug report

If the value parameter of a Spinbox is set, even to an int, the increment/decrement buttons do nothing. If this isn't the right place for this bug, sorry.

from tkinter import *
root = Tk()
intvar = IntVar(root)
spinbox_with_value = Spinbox(root, from_ = 1, to = 12, value = 12, textvariable = intvar)
spinbox_with_value.pack()
# The text box is still editable, but the buttons do nothing.

Without the value parameter set, the buttons work.

from tkinter import *
root = Tk()
intvar = IntVar(root)
intvar.set(12) # Workaround, since the value parameter doesn't work
spinbox_without_value = Spinbox(root, from_ = 1, to = 12, textvariable = intvar)
spinbox_without_value.pack()
# This works as intended.

Your environment

  • CPython versions tested on: 3.11.1, 3.9.8, 3.6.2
  • Operating system and architecture: Windows 10 22H2

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions