本文整理匯總了Python中vispy.util.event.EmitterGroup.auto_connect_format方法的典型用法代碼示例。如果您正苦於以下問題:Python EmitterGroup.auto_connect_format方法的具體用法?Python EmitterGroup.auto_connect_format怎麽用?Python EmitterGroup.auto_connect_format使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vispy.util.event.EmitterGroup
的用法示例。
在下文中一共展示了EmitterGroup.auto_connect_format方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_group_autoconnect
# 需要導入模塊: from vispy.util.event import EmitterGroup [as 別名]
# 或者: from vispy.util.event.EmitterGroup import auto_connect_format [as 別名]
def test_group_autoconnect(self):
"""EmitterGroup auto-connect"""
class Source:
def on_em1(self, ev):
self.result = 1
def em2_event(self, ev):
self.result = 2
def em3_event(self, ev):
self.result = 3
src = Source()
grp = EmitterGroup(source=src, em1=Event, auto_connect=False)
src.result = None
grp.em1()
assert src.result is None
grp = EmitterGroup(source=src, em1=Event, auto_connect=True)
src.result = None
grp.em1()
assert src.result == 1
grp.auto_connect_format = "%s_event"
grp.add(em2=Event)
src.result = None
grp.em2()
assert src.result == 2
grp.add(em3=Event, auto_connect=False)
src.result = None
grp.em3()
assert src.result is None