display.py 文件源码

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

项目:sshchan 作者: einchan 项目源码 文件源码
def quit_prompt(self):
        """Pop-up window that appears when you try to quit."""
        # Nothing fancy here.
        question = ur.Text(("bold", "Really quit?"), "center")
        yes_btn = ur.AttrMap(ur.Button(
            "Yes", self.button_press, "quit"), "red", None)
        no_btn = ur.AttrMap(ur.Button(
            "No", self.button_press, "back"), "green", None)

        prompt = ur.LineBox(ur.ListBox(ur.SimpleFocusListWalker(
            [question, self.div, self.div, no_btn, yes_btn])))

        # The only interesting thing in this method is this Overlay widget.
        overlay = MyOverlay(
            prompt, self.loop.baseWidget,
            "center", 20, "middle", 8,
            16, 8,
            parent=self)
        self.loop.Widget = overlay
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号