当前位置: 首页>>代码示例>>Python>>正文


Python event.EventDispatcher类代码示例

本文整理汇总了Python中kivy.event.EventDispatcher的典型用法代码示例。如果您正苦于以下问题:Python EventDispatcher类的具体用法?Python EventDispatcher怎么用?Python EventDispatcher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EventDispatcher类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __getattribute__

 def __getattribute__(self, key):
     #        print ">> Trying to get %s" % key
     if key in ("_model_attr", "__parent", "_model_class", "_model"):
         return object.__getattribute__(self, key)
     elif key in self._model_attr:
         #            print "    INTERCEPTED!"
         # Get the value of this key from the common data model
         val = getattr(self.__parent, key)
         #            print "  val or %s is %s" % (key, val)
         # Typecase as needed
         if isinstance(val, list):
             # Construct a list of property objects
             val2 = []
             for a in val:
                 # We have to create a whole new UI model for these...
                 # class SubModel(UI_DataModel):
                 #    _model_class = type(a)
                 # val2.append(SubModel(a))
                 val2.append(str(a))
         else:
             val2 = str(val)
         # Invoke kivy's Property setter by setting our attribute
         setattr(self, key, val2)
         # Proceed as normal
         return EventDispatcher.__getattribute__(self, key)
     else:
         #            print "    Pushing up to base class"
         return EventDispatcher.__getattribute__(self, key)
开发者ID:jsexauer,项目名称:ItBuildsCharacter,代码行数:28,代码来源:data_model_wrapper.py

示例2: __init__

 def __init__(self, anim, widget):
     EventDispatcher.__init__(self)
     self.anim = anim
     self.widget = widget
     self.anim.bind(on_start=self._anim_started,
                    on_progress=self._anim_progress,
                    on_complete=self._anim_completed)
开发者ID:2xR,项目名称:legacy,代码行数:7,代码来源:animation.py

示例3: __new__

 def __new__(cls, **kwargs):
     if cls.__instance is None:
         cls.__instance = EventDispatcher.__new__(cls)
     return cls.__instance
开发者ID:derekstavis,项目名称:kivy,代码行数:4,代码来源:__init__.py

示例4: __init__

	def __init__(self, tile, maze, **kwargs):
		MazeObject.__init__(self, tile=tile)#inherits from MazeObject
		EventDispatcher.__init__(self, **kwargs)
		self.orientation = 0 #0,1,2,3 = left,right,up,down
		self.maze = maze
开发者ID:akdor1154,项目名称:fit3140,代码行数:5,代码来源:simulation.py


注:本文中的kivy.event.EventDispatcher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。