本文整理汇总了Python中gi.repository.Clutter.threads_init方法的典型用法代码示例。如果您正苦于以下问题:Python Clutter.threads_init方法的具体用法?Python Clutter.threads_init怎么用?Python Clutter.threads_init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Clutter
的用法示例。
在下文中一共展示了Clutter.threads_init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import threads_init [as 别名]
def run(self):
# Import clutter only in the gobject thread
# This function will be the running mainloop
try:
from gi.repository import Clutter as clutter
clutter.threads_init()
clutter.init([])
clutter.main()
except Exception, e:
log.exception('unable to import clutter')
return
示例2: create_ui
# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import threads_init [as 别名]
def create_ui(self):
Clutter.init()
Clutter.threads_init()
self.clutter = GtkClutter.Embed()
self.clutter.set_size_request(420, 280)
self.stage = self.clutter.get_stage()
self.stage.set_background_color(Clutter.Color
.from_string('#8c8c8c')[1])
self.stage.show_all()
self.widget.add(self.clutter)
示例3: remove_entity
# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import threads_init [as 别名]
return config
def remove_entity(self, ent):
times = 0
for entity in self.entities_dict.keys():
if entity.doc == ent.doc: times += 1
if times > 1:
ent.delete()
del self.entities_dict[ent]
return True
return False
if __name__ == "__main__":
GLib.threads_init()
Clutter.threads_init()
Clutter.init(sys.argv)
Clutter.threads_enter()
directory = os.getcwd()
if len(sys.argv) > 1:
directory = sys.argv[1]
desktop = Desktop(directory)
desktop.run()
Clutter.threads_leave()