def button_control_name(v, idx=None):
    """Return the name of a setting's button

    v - the setting

    idx - if present, the index of one of several buttons for the setting
    """
    if idx is None:
        return "%s_button" % (str(v.key()))
    else:
        return "%s_button_%d" % (str(v.key()), idx)