[377] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: revised curve plus new gamma widget

daemon@ATHENA.MIT.EDU (Peter Mattis)
Tue Jun 17 22:33:49 1997

To: gtk-list@redhat.com
In-reply-to: Your message of "Sun, 08 Jun 1997 22:02:47 PDT."
             <199706090502.WAA22928@panda.mosberger> 
Date: Tue, 10 Jun 1997 16:16:55 -0700
From: Peter Mattis <petm@scam.XCF.Berkeley.EDU>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com


David Mosberger-Tang writes:
>There is a slight problem with the pixmaps: i wanted to make the
>background transparent, but when doing so, the _entire_ pixmap became
>transparent.  I couldn't figure out what's going wrong, so if anybody
>has a suggestion, I'm all ears (just search for "why does this not
>work" in the patch below and you'll see what I mean...).

One problem is that your xpm's don't define a transparent color. For
instance, I changed the "c" color of the "spline" xpm to "c c None"
and now it does the transparency correctly. But, there is still a bug
here since if no transparent pixels are defined in the xpm then the
mask should be filled. And it does this correctly on my system. I
suspect that assuming the white color is composed of all bits set
(0xffffffff) is an error. Let me know if the following patch works for
you.

Peter

--- gdkpixmap.c.bak     Tue Jun 10 16:11:09 1997
+++ gdkpixmap.c Tue Jun 10 16:18:35 1997
@@ -411,9 +411,12 @@
 
                  *mask = gdk_pixmap_new (window, width, height, 1);
                  gc = gdk_gc_new (*mask);
+
+                 tmp_color.pixel = 0;
+                 gdk_gc_set_foreground (gc, &tmp_color);
                  gdk_draw_rectangle (*mask, gc, TRUE, 0, 0, -1, -1);
 
-                 gdk_color_white (colormap, &tmp_color);
+                 tmp_color.pixel = ~((gulong) 0);
                  gdk_gc_set_foreground (gc, &tmp_color);
                }
 
@@ -546,9 +549,12 @@
 
       *mask = gdk_pixmap_new (window, width, height, 1);
       gc = gdk_gc_new (*mask);
+
+      tmp_color.pixel = 0;
+      gdk_gc_set_foreground (gc, &tmp_color);
       gdk_draw_rectangle (*mask, gc, TRUE, 0, 0, -1, -1);
 
-      gdk_color_white (colormap, &tmp_color);
+      tmp_color.pixel = ~((gulong) 0);
       gdk_gc_set_foreground (gc, &tmp_color);
     }
 

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post