most of GUI event system implemented