Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gtk signal_connect error
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
G|N|
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2004
Posts: 138
Location: Turnhout (Belgium)

PostPosted: Tue May 02, 2006 12:46 pm    Post subject: gtk signal_connect error Reply with quote

i am trying to write a little perl/Gtk app by hand and now i am stuck on this (probably) stupid mistake :roll:

when i click on one of the buttons on the dialog, a sub has to be called with extra arguments (textfields, checkbutton) but i can't get the arguments to work in the sub!


Code:

   
$dialog->signal_connect('response' , sub {
        my ($dialog, $response, @data) = @_;

        if($response eq 'ok'){
            $uid = $data[0]->get_text;
            $passwd = $data[1]->get_text;
            print $uid; #just for testing
            print $passwd; #just for testing
            if ($data[3]->get_active) {
                &write_configFile;
            }
            else {
                &remove_configFile;
            }
            $dialog->destroy;
        }
        else{
          $dialog->destroy;
        }
    },[$txtLogin, $txtPassword, $checkRemember] );

when i press the ok button, i get this error:

Code:

*** unhandled exception in callback:
***   Can't call method "get_text" on unblessed reference 
this means that $data[0] is unblessed, but how can i solve it?

thanks

btw: this is perl/gtk
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum