small tkinter problem

Martin Franklin mfranklin1 at gatwick.westerngeco.slb.com
Wed Jul 31 10:00:43 EDT 2002


On Wednesday 31 Jul 2002 12:47 pm, Raimo Tuisku wrote:
> On Wed, 31 Jul 2002 15:51:26 +0300, oberon wrote:
> >   File "D:\projects\oberon\mdbapp.py", line 21, in __init__
> >     self.results = Listbox(frame,
> > yscrollcommand=self.rescroll.set).grid(row=4,column=0,sticky=W+E,columnsp
> >an=2) AttributeError: 'NoneType' object has no attribute 'set'
>
> The error message says it all:
> >     self.rescroll = Scrollbar(frame).grid(row=4,column=2)
>
> You set the return value of grid to self.rescroll which is none.


IOW

self.results = Listbox(frame,yscrollcommand=self.rescroll.set)
self.results.grid(row=4,column=0,sticky=W+E,columnspan=2)


binding the  name self.results to the Listbox NOT the return value of the 
grid method of the Listbox will give you the desired result


Regards
Martin





More information about the Python-list mailing list