Code to set buttons programmatically.