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
评论列表
文章目录