make BaseWidget class virtual
add helper function AddEventHook to BaseWidget class