def METHOD_NAME(self, treeview, event):
    if event.button == 3:
        x = int(event.x)
        y = int(event.y)
        pthinfo = treeview.get_path_at_pos(x, y)
        if pthinfo is not None:
            path, col, cellx, celly = pthinfo
            self.selected_path = path
            treeview.grab_focus()
            treeview.set_cursor(path, col, 0)
            tree_iter = self.store.get_iter(self.selected_path)
            app = self.store.get_value(tree_iter, 3)
            self.inspect_app.set_sensitive(app != "<untracked>")
            self.popup.popup(None, None, None, None, event.button, event.time)
        return True