Commit | Line | Data |
---|---|---|
1 | #!/usr/bin/env perl | |
2 | use strict; | |
3 | use warnings; | |
4 | use Gtk2 -init; | |
5 | ||
6 | # Gtk2->init; works if you didn't use -init on use | |
7 | my $window = Gtk2::Window->new ('toplevel'); | |
8 | my $button = Gtk2::Button->new ('Quit'); | |
9 | $button->signal_connect (clicked => sub { Gtk2->main_quit }); | |
10 | $window->add ($button); | |
11 | $window->show_all; | |
12 | Gtk2->main; | |
13 |