KekLib.DraggableListbox#

DraggableListbox.py

adapted from

https://stackoverflow.com/questions/14459993/tkinter-listbox-drag-and-drop-with-python

class DraggableListbox(master, **kw)#

Bases: Listbox

A tk listbox with drag’n’drop reordering of entries.

Construct a listbox widget with the parent MASTER.

Valid resource names: background, bd, bg, borderwidth, cursor, exportselection, fg, font, foreground, height, highlightbackground, highlightcolor, highlightthickness, relief, selectbackground, selectborderwidth, selectforeground, selectmode, setgrid, takefocus, width, xscrollcommand, yscrollcommand, listvariable.

getState(event)#

checks if the clicked item in listbox is selected

setCurrent(event)#

gets the current index of the clicked item in the listbox

shiftSelection(event)#

shifts item up or down in listbox