Problems with Gdk::Pixbuf


I'm trying to load png data from a GD::Image object into a DrawingArea,
but I'm having problems.  This is the relevant code:

my $gd = $graph->plot(\ data);
my $drawable = new Gtk::DrawingArea();

my $pixbuf = new_from_data Gtk::Gdk::Pixbuf(
$drawable->signal_connect('expose_event', sub {
        0, 0, 0, 0,
        $pixbuf->get_width(), $pixbuf->get_height(),
        0, 50, 0, 0, 0);

But when I run it, I get this error:

variable is not of type Gtk::Gdk::Pixmap at line 68.

Line 68 is the '$pixbuf->render_to_drawable_alpha(...' line, so I'm
assuming it means there's something leftass with $pixbuf.

What's the problem, here?  I've tried with both $gd and $graph as the
data for new_from_data as well; all spit out the same error.

If more details are needed I'd be happy to provide them.

Jeremy McLeod
jeremym lawcode net

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