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


Python DOM.setEventListener方法代码示例

本文整理汇总了Python中pyjamas.DOM.setEventListener方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.setEventListener方法的具体用法?Python DOM.setEventListener怎么用?Python DOM.setEventListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyjamas.DOM的用法示例。


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

示例1: onDetach

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setEventListener [as 别名]
 def onDetach(self):
     """Called when this widget is being removed from the DOM tree of the document."""
     if not self.isAttached():
         return
     self.doDetachChildren()
     self.attached = False
     DOM.setEventListener(self.getElement(), None)
开发者ID:anandology,项目名称:pyjamas,代码行数:9,代码来源:Widget.py

示例2: onAttach

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setEventListener [as 别名]
 def onAttach(self):
     """Called when this widget has an element, and that element is on the document's
     DOM tree, and we have a parent widget."""
     if self.isAttached():
         return
     self.attached = True
     DOM.setEventListener(self.getElement(), self)
     self.doAttachChildren()
     self.onLoad()
开发者ID:anandology,项目名称:pyjamas,代码行数:11,代码来源:Widget.py

示例3: prepareImage

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setEventListener [as 别名]
 def prepareImage(self, url):
     img = Image()
     img.__isLoaded = False
     img.addLoadListener(self)
     # normally, event listeners are only set up when the widget
     # is attached to part of the DOM (see Widget.onAttach).  but,
     # in this case, we want a load even _even though_ the Image
     # widget is not yet attached (and quite likely won't be).
     DOM.setEventListener(img.getElement(), img)
     return img
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:12,代码来源:ImageLoader.py

示例4: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setEventListener [as 别名]
   def __init__(self):
      self._dragging = False
      Canvas.__init__(self, Width=WIDTH, Height=HEIGHT)
      canvasElement = self.getElement()
      #Register for canvas mouse events
      self._proc = Processing(DOM.getFirstChild(canvasElement))
      self._proc.setup = (lambda: self.setup_proc())
      self._proc.draw = None
      self._proc.init()

      DOM.sinkEvents(canvasElement, Event.MOUSEEVENTS)
      DOM.setEventListener(canvasElement, self)

      self._currentPointList = []

      self._x = None
      self._y = None

      self._callback_Redraw = None
      self._callback_AddStroke = None
      self._callback_DeleteStroke = None
开发者ID:ASayre,项目名称:UCSBsketch,代码行数:23,代码来源:PyjSketchGUI.py

示例5: doDetachChildren

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setEventListener [as 别名]
 def doDetachChildren(self):
     for child in self:
         child.onDetach()
     DOM.setEventListener(self.focusable, None);
开发者ID:anandology,项目名称:pyjamas,代码行数:6,代码来源:Tree.py

示例6: doAttachChildren

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setEventListener [as 别名]
 def doAttachChildren(self):
     for child in self:
         child.onAttach()
     DOM.setEventListener(self.focusable, self);
开发者ID:anandology,项目名称:pyjamas,代码行数:6,代码来源:Tree.py

示例7: onAttach

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setEventListener [as 别名]
    def onAttach(self):
        #print "Composite.onAttach", self
        self.widget.onAttach()
        DOM.setEventListener(self.getElement(), self);

        self.onLoad()
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:8,代码来源:Composite.py


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