factored btn_* from ui.c to btn.c