tkinter.tix "Control" widget don't work with StringVar?
Terry Reedy
tjreedy at udel.edu
Sat Jun 1 22:06:37 EDT 2019
On 6/1/2019 9:28 PM, jfong at ms4.hinet.net wrote:
> Below is a simplified version of the sample script downloaded from its package.
> When run it, the entry field display '0' instead of 'P&W'.
> PS. I am using Python 3.4.4, Windows 32bit
>
> ----test0.py----
> 1 from tkinter import tix as Tix
> 2
> 3 root = Tix.Tk()
> 4
> 5 demo_maker = Tix.StringVar()
> 6 demo_maker.set('P&W')
> 7
> 8 c = Tix.Control(root, label='Engine Maker: ',
> 9 variable=demo_maker,
> 10 options='entry.width 10 label.width 20 label.anchor e')
> 11 c.pack(side=Tix.TOP, anchor=Tix.W)
> 12
> 13 root.mainloop()
> --------
Line numbers interfere with copy and paste.
Control or Spinbox controls a number that can be increased or decreased
with the arrows. You can use a number string like '33' or Intvar or
Floatvar.
Note that tix is unmaintained, deprecated, and generally not advised for
new code (or new users).
--
Terry Jan Reedy
More information about the Python-list
mailing list