Maybe this sample might help. This a a part of my code to set the color of the text view caret. With similar method you can probably set the global style in your application too (for example, to paint all GtkTextView widgets in your application).

static const char cursor_color_rc[] =
           "style \"Notecase\"\n"
           "{\n"
           "GtkTextView::cursor-color=\"#%04x%04x%04x\"\n"
           "}\n"
           "widget \"*.GtkTextView*\" style : application \"Notecase\"\n";

   gchar *rc_temp = g_strdup_printf (cursor_color_rc,
                          color.red,
                           color.green,
                           color.blue);
   gtk_rc_parse_string (rc_temp);
   gtk_widget_reset_rc_styles (g_text.m_pWidget);
   g_free (rc_temp);


----- Original Message ----- From: "XiuHua Wu" <[EMAIL PROTECTED]>
To: <gtk-app-devel-list@gnome.org>
Sent: Thursday, September 04, 2008 9:14 AM
Subject: About the GTK style


Hi All:
Is there anyone knows how to set the GTK styles by codes not via the rc file??I had tried the gtk_rc_add_class_style function, but it didn't work and it is said that "|gtk_rc_add_class_style| is deprecated and should not be used in newly-written code". So is the gtk_rc_add_class_style function available for GTK-2.12.8, if available how to use it ? Or are there any other methods or functions to achieve the purpose(using the codes to set the styles) ??
     Thanks in advance!

--
Sincerely,
Vanevan
[EMAIL PROTECTED]

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

__________ Information from ESET NOD32 Antivirus, version of virus signature database 2945 (20080313) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to