Tkinter/Listbox question

David Miller dmillerON at MAPSmote.rsn.com
Mon May 10 16:20:59 EDT 1999


Hi all:)

I need to have a scrolling listbox have drag-and-drop
reordering of the list.  From the manpage:

Much of the behavior of a listbox is determined  by  its
selectMode  option,  which selects one of four ways of
dealing with the selection.  If  the  selection  mode  is
single or browse, at most one element can be selected in
the listbox at once.   In  both modes, clicking button 1 on
an element selects it and des- elects any other selected item.
In browse mode it is also possible to drag the selection with button 1.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

No problem I says....

.....
        frm = frame(self, TOP)
        play = Listbox(frm)
        self.play = play
        scroll = Scrollbar(frm)
        play.config(yscrollcommand=scroll.set, relief=SUNKEN, \
		height=20, width=40)
        play.config(selectmode=BROWSE)
......


Unfortunately, it doesn't work, doesn't do anything differently
with button-1 at all.

What am I missing, or does someone have a sample drag-and-drop
listbox I can scarf?

email address should be obvious if one takes out the caps.


Thanks in advance

--- David Miller




More information about the Python-list mailing list