#!/usr/bin/env ruby
require 'gtk4'

application = Gtk::Application.new('org.gtk.example', :flags_none)

application.signal_connect(:activate) { |app|
  win = Gtk::ApplicationWindow.new(app)
  win.title = 'window'
  win.set_default_size(600, 400)

  button = Gtk::Button.new(label: 'Hello World')
  button.signal_connect(:clicked) {
    puts "Hello World"
    # win.destroy # And if we want to close it, this line should be uncommented.
  }
  win.set_child(button)
  win.show
}

application.run
