Strange bug with $dialog->vbox



Hi,

I got a strange bug report for my application which I think might be a problem with gtk and/or gtk-perl. All input is welcome.


The code snippet where it goes wrong is:

----
   my $dialog = Gtk2::Dialog->new(
       $title, undef,
              [qw/modal destroy-with-parent no-separator/],
       'gtk-cancel' => 'cancel',
       'gtk-open'   => 'ok',
   );
   $dialog->set_resizable(0);
   $dialog->set_border_width(5);
   $dialog->set_icon(
       Gtk2::Gdk::Pixbuf->new_from_file($icon_file) );
   $dialog->set_default_response('ok');
$dialog->vbox->add(
       Gtk2::Image->new_from_file($icon_file) );

   $dialog->vbox->add( Gtk2::Label->new( << 'EOT' ) );
   Welcome ...
   EOT
----

The error is at the last line which dies with: Can't call method "add" on unblessed reference at ...

So there actually is a dialog object, which does have a method 'vbox' but htis method returns undef !? 'vbox' is a struct member in the C library and I do not see how this method could fail to return a widget. What is even stranger is that one statement earlier there is a 'vbox' object because adding the image gives no error at al.

The bug is reported for gtk+ 2.8.10 with perl-Gtk2 1.101, I fail to reproduce it on any of my systems, but the highest version I tested is gtk+ 2.8.9 perl-Gtk2 1.100.

I'm out of ideas on how to fix this one so any suggestions are welcome.

-- Jaap <pardus cpan org>




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