本文整理汇总了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)
示例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)
示例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)