Pixmap not being rewritten..



I sat down this morning and started on my first GTK app. I've got to this
point and I'm stumped as to why the 'bar' pixmap doesn't appear over the
'base' pixmap...I suspect it's something to do with style but why it may
be is beyond me...


/* create the main window, and attach delete_event signal to terminating
      the application */
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_signal_connect (GTK_OBJECT (window), "delete_event",
			GTK_SIGNAL_FUNC (delete_event), NULL);
   gtk_signal_connect (GTK_OBJECT (window), "destroy",
			GTK_SIGNAL_FUNC (destroy), NULL);
/* load the base pixmap */
   basePixmap = gdk_pixmap_colormap_create_from_xpm(NULL,
		                           gtk_widget_get_colormap(window),
					    &baseMask,
					    NULL,
                                           baseFile);

   /* load the bar pixmap */
   barPixmap = gdk_pixmap_colormap_create_from_xpm(NULL,
		                           gtk_widget_get_colormap(window),
					    &barMask,
					    NULL,
                                           barFile);


   /* draw the small_xpm onto the base_xpm */
   style = gtk_widget_get_style(window);

   gdk_draw_pixmap(basePixmap,
     style->fg_gc[GTK_STATE_NORMAL], barPixmap,
     0, 0, 15, 15, -1, -1);

   pixmapWidget = gtk_pixmap_new( basePixmap, baseMask );
   gtk_widget_show( pixmapWidget );

   gtk_container_add( GTK_CONTAINER(window), pixmapWidget);

   /* and the window */
   gtk_widget_show (window);





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