adds handler to segmentedbutton