Color allocation and resizing windows - help



I am trying to write a little color mixer using GTK+. Everything is all
right, except that my color allocation does not work and the color
window (actually the window in general) is just too small (coulda groked
that from the subject, I suppose ;) ).

I don't have the code right here, but here's what I can rattle off the
top of my head.

The color window (where the color is drawn) is a GtkDrawable.
I draw the RGB values from three separate scrollbars, each initialized
by three separate adjustments.
The callback for the adjustments get the values (turning them into ints
by casting), malloc the GdkColor, assign the RGB values to the GdkColor,
and shift the red by 16, the green by 8, and the blue by none for the
pixel value. It then calls gdk_gc_set_foreground and the rest comes out
as a thin blue, green, purple, or black line.

What am I doing wrong? How do I properly allocate the colors? How do I
get the windows to be some decent size? Am I asking too many questions?
;) I can send the code if anybody wants to take a look at it.

Thanks!
Nathan



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