widget appearance getting corrupted



here is my code snippet for displaying a shaped widget .




void create_playerbar()
{

     GtkWidget *image ,*window, *pixwid;
    GdkPixbuf  *pixbuf ;
    GdkPixmap *pixmap;
      GdkBitmap  *bitmap;
      int alpha;
     alpha = 32;
      window = gtk_window_new(GTK_WINDOW_POPUP);

       image = gtk_image_new_from_file("/xyz.png");
      pixbuf = gtk_image_get_pixbuf(GTK_WIDGET(image));
      gdk_pixbuf_render_pixmap_and_mask(pixbuf, &pixmap, &bitmap,alpha);
     pixwid = gtk_pixmap_new(pixmap,bitmap);
     gtk_container_add(GTK_CONTAINER(window),pixwid);
    gtk_widget_shape_combine_mask(window,bitmap,0,0);
   gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(topwindow));




}

but whenever i do gtk_widget_show_all(GTK_WIDGET(window)) ,     corrupted
widget comes up on the screen. The appearance of the png image inside the
window (widget)
 gets corrupted . Every time it shows up some different color for the
widget.  However if i repeat closing the application and opening it for 3-4
times , then the widget shows up correctly with proper image
appearance(maintaining the color appearance of png image).

but this problem does not occur on fc3  .  it occurs on fc6  frequently.




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