I don't see what's wrong with your program, but a simple Tkinter program
not using pmw seems to work just as expected on my system.

It seems like it would be hard for Python/PMW/Tkinter to even know that
a particular option for varible= was computed by a list indexing
operation, as opposed to any other way.

Whatever problem is in your code, I think you may not have identified it
correctly.

Jeff

#------------------------------------------------------------------------
import Tkinter

# Create widgets
t = Tkinter.Tk()
m = Tkinter.Menu(t); t.configure(menu=m)
menu = Tkinter.Menu(m); m.add_cascade(menu=menu, label="Radiobuttons")
opts = [Tkinter.IntVar() for i in range(15)]

# Callback when checkbutton clicked
def print_opts():
    for i in range(15):
        print "Checkbutton %d: %d" % (i, opts[i].get())
    print 

# Populate the checkbutton menu
for i in range(15):
    menu.add_checkbutton(variable=opts[i], label="Checkbutton %d" % i,
        command=print_opts)

# Run the application
t.mainloop()
#------------------------------------------------------------------------

Attachment: pgpapb3FOzH6p.pgp
Description: PGP signature

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to