def switch_selection(rqlst, new_var, old_var):
    """Switch the select variable from old_var (VariableRef instance) to
    new_var (Variable instance).
    """
    rqlst.remove_selected(old_var)
    rqlst.add_selected(new_var, 0)
