我有以下代码,使用pygtk:
attr = pango.AttrList()
attr.change(pango.AttrSize((
50 * window_height / 100) * 1000, 0, -1))
attr.change(pango.AttrFamily("Sans", 0, -1))
attr.change(pango.AttrWeight(pango.WEIGHT_BOLD, 0, -1))
attr.change(pango.AttrForeground(65535, 65535, 65535, 0, -1))
self.label.set_attributes(attr)
Run Code Online (Sandbox Code Playgroud)
我正在尝试将它移植到pygobject,但没有类Pango.AttrFamily,既没有Pango.AttrWeight,也没有Pango.AttrForeground(我无法实例化Pango.AttrSize).
现在的问题是:如何使用pango_attr_size_new,pango_attr_weight_new,pango_attr_family_new和pango_attr_foreground_new通过instrospection?
我知道我可以使用标记来做到这一点,但是1.使用属性可以使事情更简单2.我想知道这里发生了什么!我已经花了很多时间试图解决它.