in reply to Messing with Gtk2

The problem with
Gtk2->init( \@ARGV );
is that it expects you to have something in @ARGV, i.e. command line options. Just change it to
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.


I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: Messing with Gtk2
by ghenry (Vicar) on Apr 08, 2005 at 18:05 UTC

    That did the job. Thanks a lot.

    I can now start playing and adapting the code!!

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!