odd error message



Just writing a small program to and I need to pass multiple objects
to a function being ran by a signal, but I am currently running into a
small issue.

I am expecting the code snippet below to print out the first 3
characters of the text view, but it prints out the error below. Line
74 is 'my $text=$buffer->get_text(0, 3, 1);'.



my $tab=Gtk2::TextView->new;
$save_button->signal_connect("clicked" => \&save,
                         {zconf=>$zconf, tab=>$tab});
sub save{
        my $widget=$_[0];
        my %args= %{$_[1]};

        #gets the text buffer object
        my $buffer=$args{tab}->get_buffer;

        #get the text
        my $text=$buffer->get_text(0, 3, 1);

        print $text."\n";

}



*** unhandled exception in callback:
***   expected a blessed reference at gzccrontab.pl line 74.
***  ignoring at gzccrontab.pl line 165.





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