[Glade-users] Glad + pixbuf problem



Not a programming genius to begin with, I'm stuck trying to get an image
loaded into a drawable, using Glade and GTK 1.2xx!

I'm trying to load a .jpeg onto a gnome_canvas... All the rest works - I
can show any gnome_canvas_item, without problem, but there seems to be a
problem with the image.

I load the image with gdk_pixbuf_new_from_file, no errors.
I then call gnome_canvas_set_scroll_region, which works, as the scrollbars
appear to show that the size I asked for is larger than the screen size.

Then I try to show it with:

  map = gnome_canvas_item_new(grp,
    gnome_canvas_image_get_type(),
    "pixbuf", myImage,
    "x", 0.0, "y", 0.0, "width", 800.0, "height", 400.0,
    "anchor", GTK_ANCHOR_CENTER, NULL);
  gdk_pixbuf_unref(myImage);

Which has no effect at all.

I suspect that there may be some compatibility problem with
'gnome_canvas_image_get_type' and 'pixbuf'. I'm not sure where the problem
lies though.

Suggestions appreciated!
John




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