[Tkinter-discuss] Re-arrange ttk.treeview columns via drag and drop?

Michael Lange klappnase at web.de
Fri Dec 31 13:37:17 CET 2010


Thus spoketh python at bdurham.com 
unto us on Thu, 30 Dec 2010 16:49:43 -0500:

> Is there a way to for users to re-arrange column order in the
> ttk.treeview widget? Many grid-like user interfaces allow a user
> to drag and drop columns to change column order. Any such
> capability present in the ttk.treeview widget?

You can change the order of the columns with the treeview's displaycolumns
option. The dnd handling seems to be a perfect task for the Tkdnd module,
just look at the module's demo code, it shouldn't be too hard to figure
out how it works.

Regards, and a happy new year!


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Suffocating together ... would create heroic camaraderie.
		-- Khan Noonian Singh, "Space Seed", stardate 3142.8

More information about the Tkinter-discuss mailing list