Home > other >  Consult about tkinter package
Consult about tkinter package

Time:01-14

I want to achieve in a selected the option in the drop-down list box, Spinbox parts also change the number in the range, but after I run, found the Numbers range did not change, advice on how to solve,

The following is the code:
The import tkinter as tk
The from tkinter import TTK

Def go (self) :
Global sp
Sp=tk. Spinbox (root, from_=1, the to=int (combo. The get ()))

Root=tk. Tk ()
Combo=ttk.Com bobox (root)
Combo [' value ']=(' 10 ', '20')
Combo. Bind (" & lt; & gt;" , go)
Combo. The grid ()

Sp=tk. Spinbox (root, from_=1, the to=99)
Sp. The grid ()

CodePudding user response:

First after the last row and root. The mainloop ()
Then go functions as follows:
Def go (self) :
Sp. Config (to=int (combo. The get ()))
  • Related