<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_sort_cb(self, w, index):
 """This callback is invoked when the user selects a new sort order from the preferences pane."""

        name = self.sort_options[index]
        self.t_.set(sort_order=name)