#!/usr/bin/perl # sample script to illustrate the -embed option # embed a rxvt inside another X app # see also pty-fd # doesn't handle sigchld use Gtk2; init Gtk2; my $window = new Gtk2::Window 'toplevel'; $window ->signal_connect( 'destroy' => sub{ Gtk2->main_quit; return FALSE; } ); my $frame = new Gtk2::Frame "embedded rxvt-unicode terminal"; $window->add ($frame); my $rxvt = new Gtk2::Socket; $frame->add ($rxvt); $frame->set_size_request (700, 400); $window->show_all; my $xid = $rxvt->window->get_xid; # works with rxvt but xterm loses keyboard focus system "./rxvt -embed $xid &"; #system "xterm -into $xid &"; $window->show_all; main Gtk2;