Re: About the GTK style



Thanks. The method works as using a real rc file. If I have many widgets to set, it will looks complex. And if I want to set the style of a widget class, should the string be, for examlple "class \"GtkTextView\" style : application \"Notecase\"\n", just like the contents in the rc file ?? Is there any other method which can be used to set a class style, for example just like the function gtk_rc_add_class_style(unfortunately, it didn't work for me) ?? Any way, thanks a lot.

Miroslav Rajcic wrote:
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" <xhwu grandstream com>
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
xhwu grandstream com

_______________________________________________
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



--
Sincerely,
Vanevan
xhwu grandstream com




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