Re: Problems with fillpatterns and Gtk for Windows

2006-08-04 Thread Tor Lillqvist
Guenther Sohler writes:
  On Linux and Unix my testcase works fine.

On what kind of visuals, what kind of machines? It doesn't work for me
on Linux on a x86, on a 24-bit default TrueColor visual. I get a
uniform (random?) colour in the window, like on Windows.

  What is wrong ?

  GdkColor red;
  GdkColor green;
  GdkPixmap *fillpat;
  
  char pattern[8]={0xff,0x81,0xbe,0xa5,0xa5,0xbe,0x81,0xff};
  green.red=0x; green.green=0x; green.blue=0x;
  red.red=0x; red.green=0x; red.blue=0x;
  
  gdk_color_alloc(gdk_colormap_get_system(),green);
  gdk_color_alloc(gdk_colormap_get_system(),red);
  
  fillpat=gdk_pixmap_create_from_data(NULL,pattern,8,8,1, green,red);

I certainly don't understand these things fully and by heart, and
might be confused here, but isn't it a bit odd to create a depth=1
pixmap, and then pass truecolor pixel values as foreground and
background? Shouldn't you pass GdkColors with the pixel field set to
either zero or one?

When I changed the above snippet like this:

--- sohler-1.c  Fri Aug  4 12:55:28 2006
+++ sohler-2.c  Fri Aug  4 14:00:32 2006
@@ -8,4 +8,5 @@
 printf(realize\n);
 
+GdkColor zero, one;
 GdkColor red;
 GdkColor green;
@@ -19,5 +20,8 @@
 gdk_color_alloc(gdk_colormap_get_system(),red);
 
-fillpat=gdk_pixmap_create_from_data(NULL,pattern,8,8,1, green,red);
+zero.pixel = 0;
+one.pixel = 1;
+
+fillpat=gdk_pixmap_create_from_data(NULL,pattern,8,8,1, zero,one);
 
 gc=gdk_gc_new(widget-window);

it works fine both on Linux and Windows for me.

--tml

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Problems with fillpatterns and Gtk for Windows

2006-08-04 Thread Guenther Sohler
Dear Tor,

Thank you for your reply!

Now it works!

I have always done it the wrong way so far :(
Maybe the GTK Documentation was not intuitive for me ...

Not wanting to be unpolite. Now I got a different problem .
Now the Letters of the Menus and all the other labels in my program are gone.
All of them are repalced by these square windows boxes. Just one text in a 
special location remains. Maybe Windows did not find the required font.
How can I check, if, and which font is missing ?

rds

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Problems with fillpatterns and Gtk for Windows

2006-08-04 Thread Tor Lillqvist
Guenther Sohler writes:
  Now the Letters of the Menus and all the other labels in my program
  are gone.  All of them are repalced by these square windows boxes.

Are you using a recent Pango version, and from where? Is your
pango.aliases file borked? Try using Pango 1.12.3 from
ftp://ftp.gtk.org/pub/gtk/v2.8/win32. Also, do you use the ms-windows
(wimp) theme? Does the problem go away if you don't use that? What
is your default font in the Display Properties:Appearance settings?
(Yeah, I know that is a vague question, but my memory of which font
setting it is that affects the ms-windows theme engine is also
vague...) Have you tried changing to some TrueType outline font, like
Arial?

--tml

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list