| 1 | #!/usr/bin/env perl |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | use Gtk2 -init; |
| 5 | |
| 6 | my $window = Gtk2::Window->new ('toplevel'); |
| 7 | $window->set_default_size(640, 480); |
| 8 | #$window->set_decorated(0); |
| 9 | $window->signal_connect( destroy => sub { |
| 10 | Gtk2->main_quit(); |
| 11 | }); |
| 12 | |
| 13 | my $xterm = new Gtk2::Socket; |
| 14 | $xterm->signal_connect_after( realize => sub { |
| 15 | my $xid = $_[0]->window->get_xid; |
| 16 | system "xterm -bg black -fg white -into $xid -e 'ls -l; bash' &"; |
| 17 | }); |
| 18 | |
| 19 | $window->add($xterm); |
| 20 | $window->show_all; |
| 21 | Gtk2->main; |