- self.win.clear()
- self.win.addstr("LIGHTCARDS HELP", curses.color_pair(1) +
- curses.A_BOLD)
- self.win.hline(1, 0, curses.ACS_HLINE, 15)
- self.win.addstr(2, 0, textwrap.fill(
- "Welcome to lightcards. Here are some keybindings to get you " +
- "started:", width=self.wrap_width()) +
- "\n\nh, left previous card\n" +
- "l, right next card\n" +
- "j, k, up, down flip card\n" +
- "i, / star card\n" +
- "0, ^, home go to the start of the deck\n" +
- "$, end go to the end of the deck\n" +
- "H, ? open this screen\n" +
- "e open the input file in $EDITOR\n" +
- "m open the control menu\n\n" +
- textwrap.fill(
- "More information can be found in the man page, " +
- "or by running `lightcards --help`.",
- width=self.wrap_width()) +
- "\n\nPress [q], [H], or [?] to go back.")
+ (self.help_win, self.help_panel) = self.panel_create(20, 52)
+ self.help_panel.top()
+ self.help_panel.hide()
+ self.help_win.clear()
+ self.help_win.addstr(1, 1, "LIGHTCARDS HELP", curses.color_pair(1) +
+ curses.A_BOLD)
+ self.help_win.hline(2, 1, curses.ACS_HLINE, 15)
+ text = ["Welcome to lightcards. Here are some keybindings",
+ "to get you started:",
+ "",
+ "h, left previous card",
+ "l, right next card",
+ "j, k, up, down flip card",
+ "i, / star card",
+ "0, ^, home go to the start of the deck",
+ "$, end go to the end of the deck",
+ "H, ? open this screen",
+ "e open the input file in $EDITOR",
+ "m open the control menu",
+ "",
+ "More information can be found in the man page, or",
+ "by running `lightcards --help`.",
+ "",
+ "Press [q], [H], or [?] to go back."]
+
+ for t in enumerate(text):
+ self.help_win.addstr(t[0] + 3, 1, t[1])
+
+ self.help_win.box()
+
+ def disp_help(self):
+ (mlines, mcols) = self.win.getmaxyx()
+ self.help_win.mvwin(int(mlines/2) - 10, int(mcols/2) - 26)
+ self.panel_up()
+ self.help_panel.show()