0

As recommended by pygtk itself, the way forward is GObjectIntrospection. I would like to port a C API for python which uses pygtk.h and pygobject.h. Can anyone show me the way towards documentation on how to do this ?

sagarchalise
  • 992
  • 8
  • 14
  • `pygobject.h` is still needed, only PyGTK is no longer necessary. The question is: what does the C API do? If it merely exposes custom GTK widgets to Python, you shouldn't be neededing it at all, they should already be available through gobject-introspection. – user4815162342 Jul 15 '13 at 06:38
  • Actually, https://github.com/codebrainz/geanypy is the codebase I am talking about. It exposes geany editor plugin API for python but uses pygtk. – sagarchalise Jul 15 '13 at 18:14
  • It's not obvious why it needs `pygtk.h` - searching doesn't reveal any `pygtk_` function or type being called, except for `init_pygtk()`. A good start would be to simply remove the include and see what breaks, and if the required functionality can be implemented using only PyGObject. – user4815162342 Jul 15 '13 at 19:49

1 Answers1

0

Actually pygtk_init() and pygobject_init() are macros found in pygtk headers. We should use init_pygobject() function which takes 3 arguments major, minor and micro which are version numbers or (-1, -1, -1) which is kinda default should work. Also inorder to smoothly run your ported app you may require PySys_SetArgv(0, "[]") which was in my case.

Here is the code I was trying this for:

https://github.com/sagarchalise/geanypy/tree/gtk3

sagarchalise
  • 992
  • 8
  • 14