tkview.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:chronophore 作者: mesbahamin 项目源码 文件源码
def _show_feedback_label(self, message, seconds=None):
        """Display a message in lbl_feedback, which then times out after
        some number of seconds. Use after() to schedule a callback to
        hide the feedback message. This works better than using threads,
        which can cause problems in Tk.
        """
        if seconds is None:
            seconds = CONFIG['MESSAGE_DURATION']

        # cancel any existing callback to clear the feedback
        # label. this prevents flickering and inconsistent
        # timing during rapid input.
        with contextlib.suppress(AttributeError):
            self.root.after_cancel(self.clear_feedback)

        logger.debug('Label feedback: "{}"'.format(message))
        self.feedback.set(message)
        self.clear_feedback = self.root.after(
            1000 * seconds, lambda: self.feedback.set("")
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号