Re: Problems with Gdk::Pixbuf

Jeremy McLeod <jeremym lawcode net> writes:


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 {

replace with :

after making sure drawable has been realized (but it's ok cause you are in a
expose event)

      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.

it says that it wants a Gtk::Gdk::Pixmap :)

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