Tkinter listbox question

Sylvie Bruneau sylvieb at icestormfx.com
Thu Mar 23 15:33:50 EST 2000


Hi.

    I am new to python and I am trying to create a file browser, using Tkinter.  I
have one listbox, containing all the files in the specified directory.  I also have
an Entry widget that allows me to enter the name of the file to select in the
listbox, with the keyboard.  My question is :  how can I select an entry in the
listbox if I don't know it's index ?  All methods need an index as a parameter.

    One solution would be to go trough the list of file, trying to find the one that
has been typed in the entry widget and then, set it with its index.  But this sounds
really bad to me.  I am sure that there is a method that allow me to select a listbox
entry with it's string, something like :  myListbox.select( "myFile" )...

    Someone can help me with that ?

    Thank you !

Sly





More information about the Python-list mailing list