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


Python BaseWidget.notify方法代码示例

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


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

示例1: notify

# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import notify [as 别名]
    def notify (self, event):
        """E.notify (...) -> None

        Notifies the Editable about an event.
        """
        if not self.sensitive:
            return

        # The next few events are only available, if the entry is focused.
        if self.focus:
            # Blinking caret.
            # TODO: TICK events are not the best idea to use here.
            if event.signal == SIG_TICK:
                if self._counter == 50:
                    self._caret_visible = not self._caret_visible
                    self._counter = 0
                    self.dirty = True
                self._counter += 1
            
            elif event.signal == SIG_KEYDOWN:
                if base.debug: print "Editable.KEYDOWN"
                self.run_signal_handlers (SIG_KEYDOWN, event.data)
                self._input (event.data)
                self._counter = 0
                self._caret_visible= True

        BaseWidget.notify (self, event)
开发者ID:UncommonAvenue,项目名称:mm-x-ctf,代码行数:29,代码来源:Editable.py

示例2: notify

# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import notify [as 别名]
    def notify (self, event):
        """I.notify (...) -> None

        Notifies the ImageMap about an event.
        """
        if not self.sensitive:
            return

        if event.signal in SIGNALS_MOUSE:
            eventarea = self.rect_to_client ()
            if event.signal == SIG_MOUSEDOWN:
                if eventarea.collidepoint (event.data.pos):
                    self._lastevent = event
                    if event.data.button == 1:
                        self.state = STATE_ACTIVE
                        self.__click = True
                    self.run_signal_handlers (SIG_MOUSEDOWN, event.data)
                    event.handled = True
            
            elif event.signal == SIG_MOUSEUP:
                if eventarea.collidepoint (event.data.pos):
                    self._lastevent = event
                    self.run_signal_handlers (SIG_MOUSEUP, event.data)
                    if event.data.button == 1:
                        if self.state == STATE_ACTIVE:
                            self.state = STATE_ENTERED
                        else:
                            self.state = STATE_NORMAL
                        if self.__click:
                            self.__click = False
                            self.run_signal_handlers (SIG_CLICKED)
                    event.handled = True
                elif (event.data.button == 1) and (self.state == STATE_ACTIVE):
                    self.__click = False
                    self.state = STATE_NORMAL

            elif event.signal == SIG_MOUSEMOVE:
                if eventarea.collidepoint (event.data.pos):
                    self._lastevent = event
                    if self.state == STATE_NORMAL:
                        self.state = STATE_ENTERED
                    self.run_signal_handlers (SIG_MOUSEMOVE, event.data)
                    event.handled = True
                elif self.state == STATE_ENTERED:
                    self.state = STATE_NORMAL

        BaseWidget.notify (self, event)
开发者ID:BGCX067,项目名称:eyestabs-svn-to-git,代码行数:49,代码来源:ImageMap.py

示例3: notify

# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import notify [as 别名]
    def notify (self, event):
        """E.notify (...) -> None

        Notifies the Editable about an event.
        """
        if not self.sensitive:
            return

        # The next few events are only available, if the entry is focused.
        if self.focus:
            # Blinking caret.
            if event.signal == SIG_TICK:
                self._timer -= 1
                if self._timer == 0:
                    self._caretvisible = not self._caretvisible
                    self._timer = _TIMER
                    self.dirty = True
            
            elif event.signal == SIG_KEYDOWN:
                self.run_signal_handlers (SIG_KEYDOWN, event.data)
                event.handled = self._input (event.data)
                self._caretvisible= True

        BaseWidget.notify (self, event)
开发者ID:BGCX067,项目名称:eyestabs-svn-to-git,代码行数:26,代码来源:Editable.py


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