Buttons: Use parameter instead of global var for text buttons.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>