def flash(self, txt, **kwargs):
"""Display a message that is automatically removed after some time.
If we flash a new message before the old flashed message are removed,
we old flashed message are removed.
"""
if self.__timeout:
GObject.source_remove(self.__timeout)
self.display(txt, **kwargs)
def f(self=self):
self.__timeout = None
if self.__stack:
self.display(self.__stack[-1][0], **self.__stack[-1][1])
else:
self.empty()
self.__timeout = GObject.timeout_add(2000, f)
评论列表
文章目录