Re: GTK+ & images



On Sun, 9 Jan 2005 18:20:41 +0000 (Local time zone must be set--see zic manual 
[...]

Hmmm, here you are creating a GtkWindow: 
    /* create window, set default height and width to 200 pixels */
    window = g_object_new(GTK_TYPE_WINDOW,
                          "default-height", 640,
                          "default-width", 480,
                          "border-width", 12,
                          "title", "Kiosk",
                          NULL);

And now you create a GtkImage:
    image = g_object_new(GTK_TYPE_IMAGE, "file", "Background.jpg", NULL);

And now you are calling function that takes GdkWindow & GdkPixmap arguments:
    gdk_window_set_back_pixmap((GdkWindow *)window, (GdkPixmap *)image, FALSE);

I'd say that your not out of the woods yet ;-p

You'll find the GdkWindow your looking for hanging around in 
GTK_WIDGET(widget)->window once that window is realized
(you can g_signal_connect_after (... "realize".. ) if you need to be
notified, otherwise just calling gtk_widget_realize (widget) first
might work).

You should browse the API docs in GDK (specificly the windows & pixmap
& pixbuf sections), to find out the most suitable way to aquire a GdkPixmap;
Note that a GdkPixmap in "X" terms in synonymous to Pixmap (and offscreen
server side drawable).

Cheers,
                                       -Tristan



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