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 ?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top