def back(self, terminate=False):
if app.mode == "index" and terminate:
frilly_exit()
elif self.overlay_p():
self.loop.widget = self.loop.widget[0]
elif self.window_split:
# display a confirmation dialog before killing off an in-progress post
buttons = [
urwid.Text(("bold", "Discard current post?")),
urwid.Divider(),
cute_button(("10" , ">> Yes"), lambda _: [
self.remove_overlays(),
self.index()
]),
cute_button(("30", "<< No"), self.remove_overlays)
]
# TODO: create a central routine for creating popups. this is getting really ridiculous
popup = OptionsMenu(
urwid.ListBox(urwid.SimpleFocusListWalker(buttons)),
**frame_theme())
self.loop.widget = urwid.Overlay(
popup, self.loop.widget,
align=("relative", 50),
valign=("relative", 25),
width=30, height=6)
else:
mark()
self.index()
评论列表
文章目录