add event handler util and inherit in Button and Palette