Howto set colour?



Hi all,
I have a small problem:

I would like to set the colour of a DrawingArea (or any other widget for
that matter).

I think I saw this on the mailing list some time ago, but I cannot find
it again ( the link to
the archive is incorrect ).

I have tried:

int
gui_ColorSlider::UpdateColorEntry(void){
  double color[3];
  // This is ugly maybe there is a better way?
  gtk_color_selection_get_color(
GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(_myColorSelection)->colorsel),
color );

  GdkColormap *CM = gtk_widget_get_colormap( _ColorButtonDA );
  GdkColor C;
  C.red   =  (gushort)( 65535 * color[0] );
  C.green =  (gushort)( 65535 * color[1] );
  C.blue  =  (gushort)( 65535 * color[2] );
  gdk_color_change ( CM, &C );
}

Anyway I'd really appreciate any help.

TIA
/Peter



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