Creating a button with code?

I want to create a script that draws/creates a button, but I have no idea how to do it.

Thank you so much. It worked perfectly.