NULL window (pixmap)



Hi again;

I solved the problem of the bin (child), also I have another problem.

When I try to add the image (im adding the image to a box), I get:

Gdk-WARNING **: Creating pixmap from xpm with NULL window and colormap

The function that creates the pixmap and the label:

GtkWidget *design_button(GtkWidget *parent, gchar *text, gchar *file) {
  GtkWidget *label, *group, *image;
  GdkPixmap *pixmap;
  GdkBitmap *mask;
  GtkStyle *stlyle;


  group = gtk_vbox_new(FALSE,1);
  gtk_container_border_width (GTK_CONTAINER (group), 2);

  style = gtk_widget_get_style(parent);
  pixmap = gdk_pixmap_create_from_xpm (parent->window, &mask, 
                                         &style->bg[GTK_STATE_NORMAL], 
                                         file);
  image = gtk_pixmap_new(pixmap, mask);
  label = gtk_label_new(text);

  gtk_box_pack_start(GTK_BOX(group), image, FALSE, FALSE, 3);
  gtk_box_pack_start(GTK_BOX(group), label, FALSE, FALSE, 3);

  return (grupo);
}

Also, the 'parent' widget its the principal 'window' object, I call
function from:

  button = gtk_button_new();
  gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC
(gtk_exit), NULL);
  button_cont = desing_butto(window, "Hello", "raton.xpm");
  gtk_widget_show(button_cont);
  gtk_box_pack_start(GTK_BOX (box_h), button, TRUE, TRUE, 1);
  gtk_container_add(GTK_CONTAINER (button), button_cont);  

Why could Im getting that error? 

Gdk-WARNING **: Creating pixmap from xpm with NULL window and colormap

(Sorry for the long message).

Paul Fischer




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