test1.pl
changeset 0 43c199fb1993
child 1 90185416e8ff
equal deleted inserted replaced
-1:000000000000 0:43c199fb1993
       
     1 #!/usr/bin/perl -w
       
     2 #$Id$
       
     3 #
       
     4 
       
     5 use strict;
       
     6 use warnings;
       
     7 
       
     8 use Gtk2 '-init';
       
     9 use Gtk2::GladeXML;
       
    10 use Gtk2::Gdk::Keysyms; # keyboard code constants
       
    11 
       
    12 my $glade;
       
    13 my $label;
       
    14 my $field;
       
    15 my $window_about;
       
    16 
       
    17 # load UI
       
    18 $glade = Gtk2::GladeXML->new("test1.glade");
       
    19 
       
    20 # connect signals
       
    21 $glade->signal_autoconnect_from_package('main');
       
    22 
       
    23 $label = $glade->get_widget('label1');
       
    24 $field = $glade->get_widget('yourname_field');
       
    25 $window_about = $glade->get_widget('aboutdialog1');
       
    26 
       
    27 Gtk2->main;
       
    28 
       
    29 exit 0;
       
    30 
       
    31 
       
    32 
       
    33 # Handles window-manager-quit: shuts down gtk2 lib
       
    34 sub on_main_delete_event {Gtk2->main_quit;}
       
    35 
       
    36 # Handles close-button quit
       
    37 sub on_close_button_clicked {on_main_delete_event;}