Show a JPG-Image in one window with buttons



Hallo,

thanks for all people who helped me with the JPG in a
GTK-Window. Now it works :-)
Writing the "gtk_init (...);" after the code I wrote
here was a stupid mistake ;-)

Now I want to modify the problem a little bit.
I want to show the JPG in a window with buttons and I
tried to use a drawing area.

////////////////////////////////////////////////////
.
.
.
 bild = gtk_drawing_area_new ();
 pixbuf = gdk_pixbuf_new_from_file("test.png", &err); 
 gdk_pixbuf_render_pixmap_and_mask(pixbuf, &pixmap,
NULL, 0); 
 g_object_unref(pixbuf); 
 gtk_widget_set_app_paintable(GTK_WIDGET(bild), TRUE);

 gdk_window_set_back_pixmap(bild->window, pixmap,
FALSE); /*I think here is the problem with the
following error message: "Gdk-CRITICAL **: file
gdkwindow-x11.c: line 2035
(gdk_window_set_back_pixmap): assertion `window !=
NULL' failed"*/
 g_object_unref(pixmap);
.
.
.
///////////////////////////////////////////////////
Why I can't use the drawing area so and how must I
modify the code if I want to use the image in one
window with buttons?

Bye

Christian Schneider

__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Bis zu 100 MB Speicher bei http://premiummail.yahoo.de



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