more bug fixes and buttonevent

added PTButtonClickEvent and bug fixes