gnome/gtkcanvas



Hey..
Ok so I've decided to go with gnomecanvas.
I'm having trouble drawing images to the canvas though...
Here's the code:
	
GdkImlibImage *Image = gdk_imlib_load_image ("mypng.png");

/* create a new canvas */
	gtk_widget_push_visual (gdk_imlib_get_visual ());
    gtk_widget_push_colormap (gdk_imlib_get_colormap ());
	canvas = gnome_canvas_new();	
  gtk_widget_pop_visual();
  gtk_widget_pop_colormap();
.
.
.
.
	 gnome_canvas_item_new (gnome_canvas_root(canvas),
					       gnome_canvas_image_get_type (),
					       "image", Image,
					       "x", 0,
					       "y", 0,
					       "width",(double)Image->rgb_width, 
					       "height", (double)Image->rgb_height,
					       NULL);

The image does not display, i.e. the canvas remains empty except for
non-image objects I draw to it...
What am I doing wrong?
Cheers,
Alex Mathy





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