diff --git a/didacto/view.py b/didacto/view.py index 84b0d10b640ebae1c25c9640105dee7193e4018a..ca4b5a181ee7f97ad57cc4a4747ab2ed95f514a1 100644 --- a/didacto/view.py +++ b/didacto/view.py @@ -160,8 +160,11 @@ class View(tkinter.Frame): def do_popup(self, event): # display the popup menu - self.popup.tk_popup(event.x_root, event.y_root, 0) + self.popup_item = self.tv.identify("item", event.x, event.y) + if self.popup_item[0] == "I": # display popup menu only if tree is not collapsed + self.popup.tk_popup(event.x_root, event.y_root, 0) + def open_source(self, item): """Function called by mouse right click, calls opend notation file function."""