GtkEntry color Background



Hola.
Estoy intentando cambiar el fondo d un GtkEntry pero por más que lo
intento no me deja. Nosé que estoy haciendo mal. La versión de mis
librerías Gtk es la 1.2.
I'm trying to change de background color for my GtkEntry but i can´t.
I don't know what i'm doing wrong. I have de Gtk+ 1.2 version.
This funcxtion changes the color of the background when youn click the
button.

void
on_button1_clicked                     (GtkButton       *button,
                                        gpointer         user_data)
{
  GtkRcStyle *rc_style;
  GdkColor color;
  GdkColor color2;

  color.red=65535;
  color.blue=0;
  color.green=0;
  gdk_color_parse("#FFFFCC",&color2);
  rc_style=gtk_rc_style_new();
  rc_style->fg[GTK_STATE_NORMAL]=color;
  rc_style->bg[GTK_STATE_NORMAL]=color2;
  rc_style->base[GTK_STATE_NORMAL]=color2;
  rc_style->text[GTK_STATE_SELECTED]=color;
  rc_style->color_flags[GTK_STATE_NORMAL]|=GTK_RC_FG;
  rc_style->color_flags[GTK_STATE_NORMAL]|=GTK_RC_BG;
  rc_style->color_flags[GTK_STATE_NORMAL]|=GTK_RC_BASE;
  rc_style->color_flags[GTK_STATE_SELECTED]|=GTK_RC_TEXT;
 //gtk_widget_modify_style(GTK_WIDGET(GTK_BIN(button)->child),rc_style);
  gtk_widget_modify_style(GTK_WIDGET(user_data),rc_style);
  gtk_rc_style_unref(rc_style);
  g_print("cambiado el estado\n");
}




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