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


Python DOM.buttonClick方法代码示例

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


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

示例1: onClick

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import buttonClick [as 别名]
    def onClick(self, sender=None):
        """
        Called when the user finishes clicking on this button.
        The default behavior is to fire the click event to
        listeners. Subclasses that override onClickStart() should
        override this method to restore the normal widget display.
        """
        # Allow the click we're about to synthesize to pass through to the
        # superclass and containing elements. Element.dispatchEvent() is
        # synchronous, so we simply set and clear the flag within this method.
        self.allowClick = True

        # Mouse coordinates are not always available (e.g., when the click is
        # caused by a keyboard event).
        evt = None # we NEED to initialize evt, to be in the same namespace
                   # as the evt *inside* of JS block

        # We disallow setting the button here, because IE doesn't provide the
        # button property for click events.

        # there is a good explanation about all the arguments of initMouseEvent
        # at: https://developer.mozilla.org/En/DOM:event.initMouseEvent

        DOM.buttonClick(self.getElement())
        self.allowClick = False
开发者ID:Afey,项目名称:pyjs,代码行数:27,代码来源:CustomButton.py

示例2: testButtonClick

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import buttonClick [as 别名]
    def testButtonClick(self):

        self.buttonClickTestOccurred = False

        self.b = Button("Click Me", self)
        RootPanel('tests').add(self.b)
        self.write_test_output('addButton')

        # simulate button click
        DOM.buttonClick(self.b.getElement())

        if not RootPanel('tests').remove(self.b):
            self.fail("Button added but apparently not owned by RootPanel()")
        self.write_test_output('removeButton')
开发者ID:Afey,项目名称:pyjs,代码行数:16,代码来源:EventTest.py


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