Tkinter listbox selection handling

Tim Daneliuk tundra at tundraware.com
Sun Nov 10 12:20:07 EST 2002


Anton Vredegoor wrote:
> On 09 Nov 2002 23:48:05 GMT, Tim Daneliuk <tundra at tundraware.com>
> wrote:
> 
> 
>>class myUI:
>>
>>    def __init__(self, root):
>>
>>        # Setup the visual elements
>>        self.hSB = Scrollbar(root, orient=HORIZONTAL)
>>        self.vSB = Scrollbar(root, orient=VERTICAL)
>>        self.listbox = Listbox(root,
>>                               foreground = FCOLOR,
>>                               background  = BCOLOR,
>>                               font = (FNAME, FSZ, FWT),
>>                               selectmode=SINGLE,
>>                               exportselection=0,
>>                               xscrollcommand=self.hSB.set,
>>                               yscrollcommand=self.vSB.set,
>>                               height = HEIGHT,
>>                               width = WIDTH,
>>                               )
>>
>>        self.hSB.config(command=self.y.xview)
>>        self.hSB.pack(side=BOTTOM, fill=X)
>>        self.vSB.config(command=self.DirList.yview)
>>        self.vSB.pack(side=RIGHT, fill=Y)
>>        self.DirList.pack(side=LEFT, fill=BOTH, expand=1)
> 
> 
> Here self.Dirlist is used, but where is it bound to an object?
> 
> Anton.
> 

Whoops - a transcription error - it is, indeed:   self.listbox.pack....

-- 
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com




More information about the Python-list mailing list