If you want the button to be within the window you created, then it has to be something like this
PHP Code:
new GuiWindowCtrl("MyWindow") {
new GuiButtonCtrl("MyButton") {
width = 70;
height = 30;
x = 10;
y = 30;
text = "Press Me";
}
}
function MyButton.onAction() {
player.chat = "Yay!";
}