File: GtkPrintOperationPreview.t

package info (click to toggle)
libgtk2-perl 1%3A1.190-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,132 kB
  • ctags: 516
  • sloc: perl: 16,575; sh: 149; ansic: 148; makefile: 76
file content (34 lines) | stat: -rw-r--r-- 1,004 bytes parent folder | download | duplicates (2)
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
31
32
33
34
#!/usr/bin/perl -w
use strict;
use Gtk2::TestHelper
  tests => 4,
  at_least_version => [2, 10, 0, "GtkPrintOperationPreview is new in 2.10"];

# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/t/GtkPrintOperationPreview.t,v 1.2 2006/08/07 18:36:05 kaffeetisch Exp $

my $op = Gtk2::PrintOperation -> new();
$op -> signal_connect(preview => sub {
  my ($op, $preview, $context, $window) = @_;

  isa_ok($op, "Gtk2::PrintOperation");
  isa_ok($preview, "Gtk2::PrintOperationPreview");
  isa_ok($context, "Gtk2::PrintContext");
  is($window, undef);

  my $surf = Cairo::ImageSurface -> create("rgb24", 1, 1);
  my $cr = Cairo::Context -> create($surf);
  $context -> set_cairo_context($cr, 72, 72);

  # This is not nice at all, but I know of no other way to convince the op that
  # now's a good time to stop blocking.
  exit;

  return TRUE;
});

$op -> run("preview", undef);

__END__

Copyright (C) 2006 by the gtk2-perl team (see the file AUTHORS for the
full list).  See LICENSE for more information.