Setting background image to Window widget



Hi All,

I am new to GTK+ programming. 
I am using the C interface to work with gtk.

I have problem in putting the background image to the 
Gtk window Widget.

my program looks like :
       gtk_init(&argc,  &argv);
       window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
       gtk_window_set_title(window, "TITLE ");

        pixmap = gdk_pixmap_create_from_xpm( 
                          GTK_WINDOW(window)->window,
                                           &bitmap,
                                           gdkcolor,
                                           filename);

        gdk_window_set_back_pixmap(window->window, 
                                     pixmap, FALSE);
        gtk_widget_show(window);
        gtk_main ();
---------------------


I got compiled successfully.

I can see the popup window but no image at background
to this window.

I got the following message at the console.

#####
(hw_click:358): Gdk-CRITICAL **:
gdk_pixmap_colormap_create_from_xpm: assertion
`drawable != NULL || colormap != NULL' failed

(hw_click:358): Gdk-CRITICAL **:
gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW
(window)' failed
####


Can anybody please point me what is the wrong and 
suggest me the right way to set the background image
to the window.


Thanks in advance.

--Seetharam







      Chat on a cool, new interface. No download required. Go to 
http://in.messenger.yahoo.com/webmessengerpromo.php




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