Color Changes Warnings



We are using GTK+1.2 and GTK--1.0.

We are trying to change the colors of some widgets using a color selection
dialog box.  Connected to the ok button of the dialog box is the following
routine.

void MyColorSelector::setIndicatorColor(double *doubles) {
  if (indicator == NULL) return;
  
  GdkColor color;
  color.red = (guint)(doubles[0] * 65535.0);
  color.green = (guint)(doubles[1] * 65535.0);
  color.blue = (guint)(doubles[2] * 65535.0);
  
  Gtk_Style *style = new Gtk_Style();
  if (type == 0) {
    style->set_bg(GTK_STATE_NORMAL, color);
  }
  else {
    style->set_fg(GTK_STATE_NORMAL, color);
  }
  indicator->set_style(*style);
}

where indicator is a pointer to Gtk_Widget and is either a Gtk_Label or
Gtk_EventBox.  The doubles pointer is a pointer to a 3 element array of
doubles that is properly allocated and set.  This code appears to act
appropriately and set the colors correctly, however, we are getting 2
strange warning messages that we cannot explain. 

They are:

Gtk-WARNING **: invalid class type `gchar' in cast to `GtkObject'

Gtk-CRITICAL **: file gtkobject.c: line 1037 (gtk_object_get_data):
assertion `GTK_IS_OBJECT (object)' failed.


What do these mean?  And how can we get rid of them?

Thank you for any help that you can provide.

Mike Lindahl
mlindahl@princeton.edu



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