本文整理汇总了Python中gi.repository.GObject.type_register方法的典型用法代码示例。如果您正苦于以下问题:Python GObject.type_register方法的具体用法?Python GObject.type_register怎么用?Python GObject.type_register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.GObject
的用法示例。
在下文中一共展示了GObject.type_register方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register_elements
# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import type_register [as 别名]
def register_elements(plugin):
gtype = GObject.type_register(Freezer)
Gst.Element.register(plugin, 'freezer', 0, gtype)
return True
示例2: plugin_init
# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import type_register [as 别名]
def plugin_init(cls, plugin):
"""Initialize the plugin."""
plugin_type = GObject.type_register(cls)
Gst.Element.register(plugin, cls.plugin_name, 0, plugin_type)
return True
示例3: __init__
# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import type_register [as 别名]
def __init__(self, git):
GObject.type_register(GtkSource.View)
self._git = git
self._builder = Gtk.Builder()
self._builder.add_from_resource('/com/nautilus/git/ui/compare.ui')
self._builder.connect_signals({
"file_changed": self._on_file_changed
})
self._window = self._builder.get_object("window")
self._build_widgets()
self._window.show_all()