How can I get the default colors in GTK?

后端 未结 2 1347
故里飘歌
故里飘歌 2021-02-20 00:06

Context

In GTK 3, people can set their own themes. Even the default theme (Adwaita) is provided with two variants: a light one and a dark one. As I am writing my own w

2条回答
  •  梦谈多话
    2021-02-20 01:09

    In your widget's do_draw() implementation, you can read out the theme colors from the widget's style context. For this you use methods such as self.get_style_context().get_color(), ...get_border_color(), ...get_background_color().

提交回复
热议问题