0

I am replacing some PyGtk code that looks like this :

pango.AttrForeground(65535, 0, 0, 0, 100)

Translating that to Gtk3 looks like this :

Pango.AttrType.FOREGROUND(65535, 0, 0, 0, 100)

However I get the error TypeError: 'AttrType' object is not callable. Googling seems to bring no results or then I searched for the wrong thing. Any ideas? Thank you very much.

Ivan Kolesnikov
  • 1,787
  • 1
  • 29
  • 45
theGtknerd
  • 3,647
  • 1
  • 13
  • 34

1 Answers1

1

Looking in the old PyGTK code it seems that pango.AttrForeground() wrapped the function pango_attr_foreground_new(). This function is marked non-introspectable in the GIR bindings, so it won't be available in the new Python libraries. I don't know the reason why; presumably there is some other way to do what the old code did.

ptomato
  • 56,175
  • 13
  • 112
  • 165
  • Thanks for giving me this heads up. I also feel there is a replacement somewhere / somehow. For now I have commented out this line and will keep my eyes open for the replacement. Maybe when I figure out what the original code did, things will become easier. Thanks again. – theGtknerd Jun 11 '17 at 01:46