Tkinter listbox question

wjk wjk at wjk.mv.com
Fri Mar 24 20:47:01 EST 2000


This may or may not help -- but in tcl/tk I usually
build my listbox with an entry widget and button
such as follows:

button .button -text "Hit Me!" -command {
    dosomething with entry variable varname
    }

entry .entry -text "" -variable varname
listbox .list -width nnn -height nnn -selectmode single etc.

then bind the list

bind .list <ButtonPress-1> {
    set varname [ .f2.list get active ]
    }

"varname goes into the entry box
when a selection is made"

grid or pack your widgets

make a selection in your list
entry box changes
use button to perform the task
(note sometimes I have had to double-click
on the entry in the list to make the change in the
entry box correctly)

Maybe someone will carry this further on in
Tkinter and I will learn more..... Have not
done much there but the principles are basically
the same.




More information about the Python-list mailing list