python - gobject.type_register() 是做什么的?

标签 python gtk pygtk gobject

在 PyGTK 中,gobject.type_register() 有什么作用? The documentation只是说

registers the specified Python class as a PyGTK type

好吧,呃。 将类注册为 PyGtk 类型有什么作用?

最佳答案

PyGTK 类型可以用作 PyGTK 属性的类型。要为 GObject 类型系统所知,必须注册一个类型。我认为您实际上不必在 PyGTK 中调用这个函数,它可能在您调用 __gobject_init__ 时自动完成。

有时 PyGTK 文档过于简洁。在这种情况下,您可能需要阅读 C docs .

关于python - gobject.type_register() 是做什么的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7927284/

相关文章:

python - 如何从textbuffer.get_text解密字符串

python - python脚本中的身份验证以root身份运行

python - pygtk多线程聊天应用程序中的问题

python /NetCDF4 : How to duplicate a NetCDF file?

Python 检查字符串是否在 dir() 中以及是否将该字符串转换为方法/函数调用

python - sqlalchemy 1.3 python 插入忽略 mysql

python - pyGtk:图像阻止窗口调整大小

python - 在 SQLAlchemy 列类型和 Python 数据类型之间轻松转换?

c++ - 没有匹配函数来调用‘Gtk::Main::run(window (&)())

fonts - Pango-警告**:无法选择字体,预期输出难看