basic function for some widgets