Tkinter question

Gabor Gludovatz ggabor at sopron.hu
Wed Dec 6 07:22:10 EST 2000


Hello,

I'd like to control two Listboxes with one scrollbar, but I am unable to
write a lambda which would call the two seperate yview functions.

here is a little piece of my code:

        self.wordlist1 = Listbox(self.dictframe_left, yscrollcommand =
self.scrollbar.set)
        self.wordlist1.pack(fill = "both", expand = 1)

        self.wordlist2 = Listbox(self.dictframe_right, yscrollcommand =
self.scrollbar.set)
        self.wordlist2.pack(fill = "both", expand = 1)

        self.scrollbar['command'] = lambda
*largs: self.wordlist1.yview(largs), self.wordlist2.yview(largs)


on the last line you can see the lambda expression.. but it's wrong from
at least three aspects...
ad1: self.wordlist1.yview in the lambda is not accessible in the lambda's
namespace
ad2: largs is a tuple
ad3: it doesn't work :)

somebody please could help me?

thanks in advance

-- 
 Gabor Gludovatz <ggabor at sopron.hu> http://www.sopron.hu/~ggabor/







More information about the Python-list mailing list