[patch] Re: revised curve plus new gamma widget




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

Yup, the patch does indeed fix the problem.  Maybe it's due to the
fact that I'm running this on an Alpha where sizeof(gulong)=8?

Anyhow, here is a patch for gtkgamma.c that fixes the remaining pixmap
definitions.

Thanks!

	--david

--- gtkgamma.c~	Sat Jun 14 12:37:57 1997
+++ gtkgamma.c	Sat Jun 14 12:25:31 1997
@@ -59,34 +59,34 @@
       /* width height ncolors chars_per_pixel */
       "16 16 4 1",
       /* colors */
-      "` c #000000",
-      "a c #BC2D2D",
-      "b c #FF0000",
-      "c c #D3D3D3",
+      ". c None",
+      "B c #000000",
+      "+ c #BC2D2D",
+      "r c #FF0000",
       /* pixels */
-      "cccccccccccccc``",
-      "cccccccccbbbbbb`",
-      "cccccccbbccccccc",
-      "ccccc`accccccccc",
-      "cccc```ccccccccc",
-      "cccca`cccccccccc",
-      "ccccbccccccccccc",
-      "cccbcccccccccccc",
-      "cccbcccccccccccc",
-      "ccbccccccccccccc",
-      "ccbccccccccccccc",
-      "cbcccccccccccccc",
-      "cbcccccccccccccc",
-      "cbcccccccccccccc",
-      "`acccccccccccccc",
-      "``cccccccccccccc"
+      "..............BB",
+      ".........rrrrrrB",
+      ".......rr.......",
+      ".....B+.........",
+      "....BBB.........",
+      "....+B..........",
+      "....r...........",
+      "...r............",
+      "...r............",
+      "..r.............",
+      "..r.............",
+      ".r..............",
+      ".r..............",
+      ".r..............",
+      "B+..............",
+      "BB.............."
     },
     /* linear: */
     {
       /* width height ncolors chars_per_pixel */
       "16 16 5 1",
       /* colors */
-      ".", /* transparent */
+      ". c None", /* transparent */
       "B c #000000",
       "' c #7F7F7F",
       "+ c #824141",
@@ -114,85 +114,85 @@
       /* width height ncolors chars_per_pixel */
       "16 16 2 1",
       /* colors */
-      "` c #FF0000",
-      "a c #D3D3D3",
+      ". c None",
+      "r c #FF0000",
       /* pixels */
-      "aaaaaaaaaaaaaaaa",
-      "aaaaaaaaaaaaaaaa",
-      "aaaaaa`aaaaaaaaa",
-      "aaaaaa`aaaaaaaaa",
-      "aaaaaaa`aaaaaaaa",
-      "aaaaaaa`aaaaaaaa",
-      "aaaaaaa`aaaaaaaa",
-      "aaaaaaaa`aaaaaaa",
-      "aaaaaaaa`aaaaaaa",
-      "aaaaaaaa`aaaaaaa",
-      "aaaaa`aaa`a`````",
-      "aaaa`aaaa`aaaaaa",
-      "aaa`aaaaa`aaaaaa",
-      "aa`aaaaaaa`aaaaa",
-      "a`aaaaaaaa`aaaaa",
-      "`aaaaaaaaaaaaaaa"
+      "................",
+      "................",
+      "......r.........",
+      "......r.........",
+      ".......r........",
+      ".......r........",
+      ".......r........",
+      "........r.......",
+      "........r.......",
+      "........r.......",
+      ".....r...r.rrrrr",
+      "....r....r......",
+      "...r.....r......",
+      "..r.......r.....",
+      ".r........r.....",
+      "r..............."
     },
     /* gamma: */
     {
       /* width height ncolors chars_per_pixel */
       "16 16 10 1",
       /* colors */
-      "` c #000000",
-      "a c #757575",
-      "b c #2F2F2F",
-      "c c #171717",
-      "d c #A4A4A4",
-      "e c #8C8C8C",
-      "f c #5E5E5E",
-      "g c #464646",
-      "h c #D3D3D3",
-      "i c #BBBBBB",
+      ". c None",
+      "B c #000000",
+      "& c #171717",
+      "# c #2F2F2F",
+      "X c #464646",
+      "= c #5E5E5E",
+      "/ c #757575",
+      "+ c #8C8C8C",
+      "- c #A4A4A4",
+      "` c #BBBBBB",
       /* pixels */
-      "hhhhhhhhhhhhhhhh",
-      "hhhhhhhhhhhhhhhh",
-      "hhhhhhhhhhhhhhhh",
-      "hhhh`fhhe`ehhhhh",
-      "hhhhgcihacdhhhhh",
-      "hhhhhaehgghhhhhh",
-      "hhhhhh`h`ehhhhhh",
-      "hhhhhhghghhhhhhh",
-      "hhhhhhgcehhhhhhh",
-      "hhhhhhd`hhhhhhhh",
-      "hhhhhhafhhhhhhhh",
-      "hhhhhhb`hhhhhhhh",
-      "hhhhhh``hhhhhhhh",
-      "hhhhhh`bhhhhhhhh",
-      "hhhhhhhhhhhhhhhh",
-      "hhhhhhhhhhhhhhhh"
+      "................",
+      "................",
+      "................",
+      "....B=..+B+.....",
+      "....X&`./&-.....",
+      "...../+.XX......",
+      "......B.B+......",
+      "......X.X.......",
+      "......X&+.......",
+      "......-B........",
+      "....../=........",
+      "......#B........",
+      "......BB........",
+      "......B#........",
+      "................",
+      "................"
     },
     /* reset: */
     {
       /* width height ncolors chars_per_pixel */
       "16 16 4 1",
       /* colors */
-      "` c #000000",
-      "a c #824141",
-      "b c #FF0000",
-      "c c #D3D3D3",
+      ". c None",
+      "B c #000000",
+      "+ c #824141",
+      "r c #FF0000",
       /* pixels */
-      "cccccccccccccc``",
-      "cccccccccccccca`",
-      "cccccccccccccbcc",
-      "ccccccccccccbccc",
-      "cccccccccccbcccc",
-      "ccccccccccbccccc",
-      "cccccccccbcccccc",
-      "ccccccccbccccccc",
-      "cccccccbcccccccc",
-      "ccccccbccccccccc",
-      "cccccbcccccccccc",
-      "ccccbccccccccccc",
-      "cccbcccccccccccc",
-      "ccbccccccccccccc",
-      "`acccccccccccccc",
-      "``cccccccccccccc"
+      "..............BB",
+      "..............+B",
+      ".............r..",
+      "............r...",
+      "...........r....",
+      "..........r.....",
+      ".........r......",
+      "........r.......",
+      ".......r........",
+      "......r.........",
+      ".....r..........",
+      "....r...........",
+      "...r............",
+      "..r.............",
+      "B+..............",
+      "BB.............."
     }
   };
 
@@ -248,7 +248,7 @@
   pm = gdk_pixmap_create_from_xpm_d (w->window, &mask,
 				     &w->style->bg[GTK_STATE_NORMAL], xpm[i]);
 
-  pixmap = gtk_pixmap_new (pm, 0 /*mask*/); /* why does this not work??? */
+  pixmap = gtk_pixmap_new (pm, mask);
   gtk_container_add (GTK_CONTAINER (w), pixmap);
   gtk_widget_show (pixmap);
 



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