Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set/get Gtk "Style Properties"

Tags:

gtk

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

So how to get and set them? using GTK+ and C.

Thanks, PP.

like image 381
User7723337 Avatar asked Mar 29 '10 09:03

User7723337


1 Answers

For example:

gint height, width;
gtk_widget_style_get(widget, "separator-height", &height,
                     "separator-width", &width, NULL);

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.

like image 56
ptomato Avatar answered Sep 21 '22 10:09

ptomato