### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: docs/_includes/example-code/window-event.raku
### ----------------------------------------------------
use v6;

use Gnome::Gtk3::Main:api<1>;                                                # 1
use Gnome::Gtk3::Window:api<1>;

my Gnome::Gtk3::Main $m .= new;                                       # 2

class AppSignalHandlers {                                             # 3
  method exit-program ( ) { $m.quit; }
}

my Gnome::Gtk3::Window $top-window .= new;                            # 4
$top-window.set-title('Example');

my AppSignalHandlers $ash .= new;                                     # 5
$top-window.register-signal( $ash, 'exit-program', 'destroy');

$top-window.show-all;                                                 # 6

$m.main;                                                              # 7


