is that it expects you to have something in @ARGV, i.e. command line options. Just change it toGtk2->init( \@ARGV );
Gtk2->init();
But that is just the start of your problems. This is old Gtk2 code from 2003, and Gtk2 has changed ALOT in the last few years. So, assuming you have the latest version, here are a couple more "fixes" needed to get it to run.
$there is no longer a GSignal !! #Gtk2::GSignal->connect( $button_poll, "clicked", \&poll_host ); #Gtk2::GSignal->connect( $button_exit, "clicked", \&exit_app ); #SHOULD BE $button_poll->signal_connect("clicked", \&poll_host ); $button_exit->signal_connect("clicked", \&exit_app );
and
sub exit_app { #Gtk2->quit(); Gtk2->main_quit(); return 0; }
and the set_text needs fixing
#$buffer->set_text( $buff, -1 ) if ( $buff ne '' ); $buffer->set_text( $buff ) if ( $buff ne '' ); .... .... #$buffer->set_text( $msg, -1 ); $buffer->set_text( $msg);
Those fixes will get you running.
In reply to Re: Messing with Gtk2
by zentara
in thread Messing with Gtk2
by ghenry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |