Gtk style / gtkrc question

I am trying to set a separate style for individual widgets, for example, for one button with a different style, and another with a different style. this style will be specified in the gtkrc file. I tried to keep an eye on things, but that didn't work.

In gtkrc file:
    style "my-style" 
    {
         engine "pixmap"
         {
              ...
         }
         ...
    }
    class "my_widget" style "my-style"

And when creating the widget, I gave the widget name specified in the gtkrc file.

In code:

       button = gtk_button_new();
       gtk_widget_set_name( button, "my_widget");
       gtk_widget_show( button );

but this stuff doesnโ€™t work, I canโ€™t see the given style for this particular widget. Is it correct? what is worn in it?

Thanks,
PP.

+3
source share
1 answer

No, this is wrong: you should read the documentation , in particular the Pathnames and patterns section.

This is not an option if you plan to seriously use resource files ...

0
source

Source: https://habr.com/ru/post/1740111/


All Articles