# nawm translation of Gtk Hello World #2.

include "gtk"

class HelloWindow : GtkWindow {
  function bool delete_event() {
    exit
  }
}

class HelloButton : GtkButton {
  string name;

  function void clicked() {
    put "Hello again - " | name | " was pressed";
  }
}

begin {
  HelloWindow win;
  HelloButton button;

  win = new HelloWindow(GTK_WINDOW_TOPLEVEL);
  win.border_width = 10;
  win.title = "Hello Buttons!";

  box1 = new GtkHBox(FALSE, 0);
  win.add(box1);

  button = new HelloButton("Button 1");
  button.name = "button 1";
  box.pack_start(box1, button, TRUE, TRUE, 0);
  button.show;

  button = new HelloButton("Button 2");
  button.name = "button 2";
  box.pack_start(box1, button, TRUE, TRUE, 0);
  button.show;  

  box.show;
  win.show;
}
