msgbox

Untitled

Oct 15th, 2011
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.58 KB | None | 0 0
  1. use warnings;
  2. use strict;
  3. use Glib qw(TRUE FALSE);
  4. use Gtk2 '-init';
  5.  
  6. my $window = Gtk2::Window->new;
  7. $window->set_title('New Title');
  8. $window->set_default_size ('250', '150');
  9. $window->signal_connect('delete-event'  => sub { $_[0]->destroy  });
  10. $window->signal_connect('destroy'       => sub { Gtk2->main_quit });
  11.  
  12.   my $hbox   = Gtk2::HBox->new;
  13.   my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file('/home/msgbox/captcha.gif');
  14.   my $image = Gtk2::Image->new_from_pixbuf($pixbuf);
  15.   $hbox->pack_start($image, TRUE, TRUE, 0);
  16.   $window->add($hbox);
  17.   $window->show_all;
  18.   Gtk2->main;
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment