Tkinter Query - Solved it
newt_e at blueyonder.co.uk
Sat Oct 12 00:02:36 CEST 2002
> Post that code... Let's take a look.
Solved it !!! I've included the source (as Chaz requested) below.
Up until now, I've used the following line to create sval:
sval = Label(wskill, text = "10").grid=(row=pos+2,col=2)
Below, I've split it into to two (after reading bits of the Python cookbook
amongst other things) as that seemed to be the recomended way.
And now it works fine. Stricly speaking, I guess I should use a textvariable
to hold the value. I might try that.
Thanks for everybodies help,
def __init__( self, parent ):
wskill = Toplevel(root)
allskills = ['Skill 1','Skilll 2','Skill 3','Skill 4']
pos = 0
self.svals = 
for skill in allskills:
sval = Label(wskill, text = "10")
dbut_callback = curry( self.down, pos, parent )
dbut = Button(wskill, text='<',
rbut = Button(wskill, text='>').grid(row=pos+2,col=3)
pos = pos + 1
def down( self, i, *crap):
a = len(self.svals)
sval = self.svals[i]
self.svals[i].configure(text = '9')
More information about the Python-list