Re: Unavoidable Pixmap warning message
- From: Joop Stakenborg <pa3aba debian org>
- To: Vikram S Bartakke <vikram unm edu>
- Cc: gtk-app-devel-list gnome org, otaylor redhat com
- Subject: Re: Unavoidable Pixmap warning message
- Date: 23 Dec 2002 23:51:21 +0100
Op ma 23-12-2002, om 21:35 schreef Vikram S Bartakke:
Hi List,
I am using following code snippet to display image icon on the screen.
GtkWidget *window, *menu_vbox;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkWidget *Img_widget;
GtkWidget *img_button;
GtkStyle *style;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_policy(GTK_WINDOW(window),FALSE,FALSE,FALSE);
gtk_container_set_border_width(GTK_CONTAINER(window),1);
gtk_widget_set_uposition(window,100,100);
gtk_widget_set_usize(window,830,450);
menu_vbox = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (menu_vbox), 1);
gtk_widget_show (menu_vbox);
style = gtk_widget_get_style(window);
pixmap = gdk_pixmap_create_from_xpm(window->window, &mask,
&style->bg[GTK_STATE_NORMAL],PENGUIN_PATH);
Img_widget = gtk_pixmap_new(pixmap, mask);
hbox2 = gtk_hbox_new(FALSE,1);
gtk_box_pack_start(GTK_BOX(hbox2), Img_widget,FALSE,TRUE,0);
gtk_container_add(GTK_CONTAINER(menu_vbox),hbox2);
This code works fine but a warning message is displayed all the time
which is
"Gdk Warning **: Creating pixmap from xpm with NULL window & colormap"
Can anyone tell me how should I remove this warning message. I am
using GTK1.2
You should realize the window before creating the pixmap,
either by using gtk_widget_realize(window) or gtk_widget_show(window).
Thanks in advance,
Vikram
========================================
Vikram S Bartakke
Grad Student (CS Dept)
University of New Mexico
Albuquerque, NM 87131
========================================
Regards,
Joop
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]