Tkinter listbox:get

Hendrik van Rooyen mail at microcorp.co.za
Fri Sep 8 05:07:42 EDT 2006


<vedran_dekovic at yahoo.com> Wrote:


| Hi,
| I need help about Tkinter.I want,when somebody click on some item in
| listbox,then
| in new entry widget must write that item
| 
| Regards,
| Vedran

I have already covered the retrieval from the listbox in another thread.
You can set the entry box contents like this:

NameOfStringForEntryboxContents = StringVar()

Then in your definition of the Entry box, add in:

textvariable = NameOfStringForEntryboxContents

and when you have retreived the listbox entry:

NameOfStringForEntryboxContents.set(NameOfStringWithListboxStuff)

and it will appear in your entry field...

HTH 
-Hendrik




More information about the Python-list mailing list