example of embeding xterm into gtk2 app
authorHarvie <tomas@mudrunka.cz>
Wed, 7 Jul 2010 22:56:51 +0000 (00:56 +0200)
committerHarvie <tomas@mudrunka.cz>
Wed, 7 Jul 2010 22:56:51 +0000 (00:56 +0200)
perl/gtk2/xterm-embed.pl [new file with mode: 0755]

diff --git a/perl/gtk2/xterm-embed.pl b/perl/gtk2/xterm-embed.pl
new file mode 100755 (executable)
index 0000000..0d12884
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Gtk2 -init;
+
+my $window = Gtk2::Window->new ('toplevel');
+$window->set_default_size(640, 480);
+$window->signal_connect( destroy => sub {
+    Gtk2->main_quit();
+});
+
+my $xterm = new Gtk2::Socket;
+$xterm->signal_connect_after( realize => sub {
+   my $xid = $_[0]->window->get_xid;
+   system "xterm -bg black -fg white -into $xid -e 'ls -l; bash' &";
+});
+
+$window->add($xterm);
+$window->show_all;
+Gtk2->main;
This page took 0.135493 seconds and 4 git commands to generate.