Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl
- #===============================================================================
- #
- # FILE: imagen.pl
- #
- # USAGE: ./imagen.pl
- #
- # DESCRIPTION: Abre imágenes desde la linea de comandos
- #
- # REQUIREMENTS: Gtk3
- # NOTES: No abrir imágenes de mas de 1mb
- # AUTHOR: (),
- # VERSION: 1.0
- # CREATED: 10/11/12 14:08:19
- #===============================================================================
- use strict;
- use warnings;
- use feature ':5.14';
- use Gtk3 -init;
- use Glib qw/TRUE FALSE/;
- if($ARGV[0]) {
- my $foto = $ARGV[0];
- my $ventana = Gtk3::Window->new('toplevel');
- $ventana->set_title("$foto");
- $ventana->set_position("mouse");
- $ventana->set_default_size(400, 100);
- $ventana->set_border_width(5);
- $ventana->signal_connect (delete_event => sub { Gtk3->main_quit });
- my $imagen = Gtk3::Image->new_from_file ("$foto");
- my $hbox = Gtk3::Box->new("vertical", 0);
- $hbox->pack_start($imagen, FALSE, FALSE, 0);
- $ventana->add($hbox);
- $ventana->show_all;
- Gtk3->main;
- } else {
- print "\n[+] Sintax : $0 <imagen>\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement