Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.55 KB | None | 0 0
  1. #! /usr/bin/perl -w
  2. use strict;
  3. use Gtk2 -init;
  4.  
  5. use Glib qw{ TRUE FALSE };
  6.  
  7. my $window = Gtk2::Window->new ('toplevel');
  8. $window->set_default_size(100,100);
  9. $window->set_position('center');
  10.  
  11. $window->signal_connect (delete_event => sub { Gtk2->main_quit });
  12. #$window->signal_connect( configure_event => sub{print $_[1]->x . "\n"; return TRUE} );
  13.  
  14.  
  15.     my $button = Gtk2::Button->new ('Action');
  16.     $button->signal_connect (clicked => sub {
  17.    
  18.         print("Hello Gtk2-Perl\n");
  19.        
  20.     });
  21.    
  22. $window->add ($button);
  23.  
  24. $window->show_all;
  25. Gtk2->main;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement