如何设置/获取Gtk“样式属性” [英] How to set/get Gtk "Style Properties"
问题描述
如何设置在gtk文档中列出的gtkStyle Properties?
like for GtkWidget有样式属性:
How to set gtk "Style Properties" listed in gtk documentation?
like for GtkWidget there are Style Properties:
"separator-height" gint : Read
"separator-width" gint : Read
那么如何获取和设置它们?使用GTK +和C。
So how to get and set them? using GTK+ and C.
感谢,
PP。
Thanks, PP.
推荐答案
例如:
For example:
gint height, width;
gtk_widget_style_get(widget, "separator-height", &height, "separator-width", &width, NULL);
它的工作方式类似于 g_object_get()
。虽然没有对应的 gtk_widget_style_set()
,但您必须通过RC文件设置它们,使用 gtk_rc_parse()
。 这里是关于RC文件的文档。
It works like g_object_get()
. There is no corresponding gtk_widget_style_set()
though, you have to set them through a RC file, which you load using gtk_rc_parse()
. Here is the documentation on RC files.
只是要清楚,用户通常不喜欢它,当你捣乱他们的主题。
Just to be clear though, users generally don't like it when you mess with their themes.
这篇关于如何设置/获取Gtk“样式属性”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!