def goto_post_prompt(self, init):
if self.mode != "thread":
return
count = self.thread["reply_count"]
live_display = urwid.Text("")
edit = JumpPrompt(count, lambda x: self.goto_post(x))
items = [
urwid.Text(("button", " Jump to post")),
urwid.AttrMap(edit, "opt_prompt"),
urwid.Text(("bold", ("(max %d)" % count).center(18, " "))),
live_display
]
urwid.connect_signal(edit, "change", self.jump_peek, live_display)
if init.isdigit():
edit.keypress((self.loop.screen_size[0],), init)
popup = OptionsMenu(
urwid.ListBox(urwid.SimpleFocusListWalker(items)),
**frame_theme())
self.loop.widget = urwid.Overlay(
popup, self.loop.widget,
align=("relative", 50),
valign=("relative", 25 if self.window_split else 50),
width=20, height=6)
评论列表
文章目录