G|N| Tux's lil' helper
Joined: 26 Feb 2004 Posts: 138 Location: Turnhout (Belgium)
|
Posted: Tue May 02, 2006 12:46 pm Post subject: gtk signal_connect error |
|
|
i am trying to write a little perl/Gtk app by hand and now i am stuck on this (probably) stupid mistake
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 |
|