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!

$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) {
           else {
   },[$txtLogin, $txtPassword, $checkRemember] );

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

*** 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?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]