source codes for switches in GUI