#!/usr/bin/perl ###################################################################### # Simple image viewing application with mouse zoom and pan. ###################################################################### use Gtk; use Gtk::ImageViewer; init Gtk; init Gtk::Gdk::Rgb; init Gtk::Gdk::Pixbuf; init Gtk::ImageViewer; if(@ARGV<1){print "Usage: imageview file\n";exit} $window = Gtk::Widget->new("GtkWindow", -type => "-toplevel", -title => "Image viewer", -delete_event => sub { print exit Gtk; } ); $image = Gtk::Widget->new("GtkImageViewer", -parent => $window, ); $file = shift; $pb = new_from_file Gtk::Gdk::Pixbuf($file); $image->set_image($pb); $window->show_all(); main Gtk;