Re: Why do I have a grey square instead of a red square?



greetings,

Am Sonntag, 14. Juli 2002 05:55 schrieben Sie:
> Jan Luehr <jluehr gmx net> writes:>
>
> > >   gdk_color_parse("red",&color_red); //Parse Red
> > >
> > >   x = gdk_color_alloc (system_colormap,&color_red);//Allocate it
> > >    printf ("Value %d\n",x); //Returns 1
>
> In GTK 2 it's much easier to use gdk_gc_set_rgb_fg_color() instead of
> using gdk_color_alloc(). (set_rgb_ doesn't require the color to be
> allocated)
>
> > >   gdk_draw_pixmap(widget->window, //Draw the second one.
> > >                   gc_red,
> > >                   pixmap_red,
> > >                   20,20,
> > >                   20,20,
> > >                   20, 20);
>
> Your problem is that the GC foreground color has no effect on drawing
> a pixmap; it only affects drawing lines, etc.

Nice. 
1st. I have 1.2 only.
2nd Can you beg me a few lines how to draw a red / green square into a pixmap 
and show it into the window?
I added these lines. The square is black now.
 gdk_draw_rectangle (pixmap_red,
		      gc_red,
		      TRUE,
		      0,0,
		      20,20);

Why?
Keep smiling
 
-- 
GnuPG Key available at http://www.jluehr.de.vu/public_key.asc



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