Re: Unavoidable Pixmap warning message



Hi,

Your Gtk window probably needs to be showed or at least nrealized before
creating the XPM in the related GDK window:

gtk_widget_realize(GTK_WIDGET(<yourwindow>));

Regards,

Patrice St-Gelais
_____________________________________

Vikram S Bartakke a écrit :

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

Thanks in advance,
Vikram

========================================
Vikram S Bartakke
Grad Student (CS Dept)
University of New Mexico
Albuquerque, NM 87131
========================================
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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