how to set the widget's background pixmap?



i am porting my software to gtk,from the mail list,i know how to setting
background pixmaps through the next function,but it work abnormal in
gtk2,if i use a gtk2 themes which set echo widget with a backgroud
pixmaps,this function will cause Segementation fault,and it don't work
fine in windows too. i hope somebady can tell me a better way to set the
widget's background pixmap,thanks!

int
SetBackPixmap (GtkWidget * widget, GdkPixmap * pixmap)
{

        gdk_window_set_back_pixmap (widget->window, pixmap, FALSE);
        //gtk_widget_queue_draw (widget);       
        gdk_window_clear (widget->window);
        return 0;
}





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