Implement getText function in Buttons