PEATDB/Tables.py
def popupMenu(self, event):
        """Add left and right click behaviour for column header"""
        colname = self.model.columnNames[self.table.currentcol]
        collabel = self.model.columnlabels[colname]
        popupmenu = Menu(self, tearoff = 0)
        def popupFocusOut(event):
            popupmenu.unpost()
        popupmenu.add_command(label="Rename Column", command=self.relabel_Column)
        popupmenu.add_command(label="Sort by "+ collabel, command=self.table.sortTable)
        popupmenu.add_command(label="Sort by "+ collabel +' (descending)', command=lambda : self.table.sortTable(reverse=1))
        popupmenu.add_command(label="Delete This Column", command=self.table.delete_Column)
        popupmenu.add_command(label="Add New Column", command=self.table.add_Column)

        popupmenu.bind("<FocusOut>", popupFocusOut)
        #self.bind("<Button-3>", popupFocusOut)
        popupmenu.focus_set()
        popupmenu.post(event.x_root, event.y_root)
        return popupmenu
Add left and right click behaviour for column header
Add left and right click behaviour for column header
Add left and right click behaviour for column header
def popupMenu(self, event):
        colname = self.model.columnNames[self.table.currentcol]
        collabel = self.model.columnlabels[colname]
        popupmenu = Menu(self, tearoff = 0)
        def popupFocusOut(event):
            popupmenu.unpost()
        popupmenu.add_command(label="Rename Column", command=self.relabel_Column)
        popupmenu.add_command(label="Sort by "+ collabel, command=self.table.sortTable)
        popupmenu.add_command(label="Sort by "+ collabel +' (descending)', command=lambda : self.table.sortTable(reverse=1))
        popupmenu.add_command(label="Delete This Column", command=self.table.delete_Column)
        popupmenu.add_command(label="Add New Column", command=self.table.add_Column)
        popupmenu.bind("<FocusOut>", popupFocusOut)
        popupmenu.focus_set()
        popupmenu.post(event.x_root, event.y_root)
        return popupmenu
def popupMenu ( self , event ) : colname = self . model . columnNames [ self . table . currentcol ] collabel = self . model . columnlabels [ colname ] popupmenu = Menu ( self , tearoff = 0 ) def popupFocusOut ( event ) : popupmenu . unpost ( ) popupmenu . add_command ( label = "Rename Column" , command = self . relabel_Column ) popupmenu . add_command ( label = "Sort by " + collabel , command = self . table . sortTable ) popupmenu . add_command ( label = "Sort by " + collabel + ' (descending)' , command = lambda : self . table . sortTable ( reverse = 1 ) ) popupmenu . add_command ( label = "Delete This Column" , command = self . table . delete_Column ) popupmenu . add_command ( label = "Add New Column" , command = self . table . add_Column ) popupmenu . bind ( "<FocusOut>" , popupFocusOut ) popupmenu . focus_set ( ) popupmenu . post ( event . x_root , event . y_root ) return popupmenu
Add left and right click behaviour for column header
Add left and right click behaviour for column header
"""Add left and right click behaviour for column header""" #self.bind("<Button-3>", popupFocusOut)
self
event