File: embed

package info (click to toggle)
rxvt-unicode 9.31-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,720 kB
  • sloc: ansic: 46,693; cpp: 17,560; perl: 3,532; makefile: 407; sh: 381
file content (30 lines) | stat: -rwxr-xr-x 502 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/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';

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;

system "rxvt -embed $xid &";

$window->show_all;

main Gtk2;