code: def _sort_column(self, column, reverse):
          
          if tk.DISABLED in self.state():
              return
          # get list of (value, item) tuple where value is the value in column for the item
          l = [(self.set(child, column), child) for child in self.get_children('')]
          # sort list using the column type
          l.sort(reverse=reverse, key=lambda x: self._column_types[column](x[0]))
          # reorder items
          for index, (val, child) in enumerate(l):
              self.move(child, "", index)
          # reverse sorting direction for the next time
          self.heading(column, command=lambda: self._sort_column(column, not reverse))
docs: Sort a column by its values