def open_menu(self, event):
        "Select Treeview row and show context menu if allowed."
        item = event.widget.identify_row(event.y)
        if item:
            event.widget.selection_set(item)
            if self.menu_allowed:
                self.__menu.post(event.x_root, event.y_root)
Select Treeview row and show context menu if allowed.
recipes/Python/577632_Directory_Pruner_1/recipe-577632.py