tkinter treeview widget - bind doubleclick to items only ?

R.Wieser address at not.available
Tue Jan 21 01:30:38 EST 2020


MRAB,

> self.treeview.bind('<Double-1>', self.on_dclick)

That is what I used.  Doubleclicking on the heading caused the "on_dclick" 
code to execute, though initially the ".identify()" call in my code returns 
an empty ID (no row present at the location I clicked).

That changes when the treeview contents are scrolled up, causing a with a 
row to be hidden behind the heading.  At that moment doubleclicking the 
heading my ".identify()" call in the "on_dclick" code returns the ID of the 
row thats hidden behind it. :-(

Shucks, it seems to be even worse:
I just scrolled a row containing children (visible by its prefixed the 
to-the-right pointing triangle) behind the heading, and double-clicking the 
heading caused that rows children to unfold and fold.

I don't think that that should be happening ...   How do I prevent it ?

Regards,
Rudy Wieser




More information about the Python-list mailing list