(self.win, self.panel) = panel_create(mlines, mcols)
self.panel.top()
self.panel.hide()
- self.win.clear()
text = [
"Welcome to runner. Here are some keybindings",
def disp(self):
"""Display help screen"""
(mlines, mcols) = self.outer.win.getmaxyx()
- self.win.mvwin(int(mlines / 2) - 10, int(mcols / 2) - 26)
- self.outer.update_panels()
+ self.win.mvwin(int(mlines / 2) - 10, int(mcols / 2) - 25)
self.panel.show()
while True:
self.win.addstr(t[0] + 3, 1, t[1])
self.win.box()
- self.outer.update_panels()
def menu_print(self, string, err=False):
"""Print messages on the menu screen"""
self.win.addch(15, i + 1, " ")
self.win.addstr(15, 1, string, color)
- self.outer.update_panels()
self.menu_grab()
def menu_grab(self):
key = self.win.getkey()
if key in ["r", "m"]:
self.panel.hide()
- self.outer.update_panels()
self.outer.get_key()
elif key == "q":
self.outer.leave()
and to continue
"""
(mlines, mcols) = self.outer.win.getmaxyx()
- self.win.mvwin(int(mlines / 2) - 9, int(mcols / 2) - 22)
+ self.win.mvwin(int(mlines / 2) - 9, int(mcols / 2) - 21)
self.panel.show()
- self.outer.update_panels()
self.menu_grab()
def run(self, stdscr):
"""Set important options that require stdscr before starting"""
self.win = stdscr
- (mlines, mcols) = self.win.getmaxyx()
curses.curs_set(0) # Hide cursor
curses.use_default_colors() # Allow transparency
curses.init_pair(1, curses.COLOR_CYAN, -1)
"Terminal too small! Min size 60x24", width=mcols
),
)
- self.win.redrawwin()
self.win.refresh()
(mlines, mcols) = self.win.getmaxyx()
time.sleep(0.1)
else:
self.disp_card()
- def update_panels(self):
- """Update panel and window contents"""
- curses.panel.update_panels()
- self.win.refresh()
-
def leave(self):
"""Pickle stack before quitting"""
if self.obj.index + 1 == len(self.stack):
Shows a header, a horizontal line, and the contents of the current
side.
"""
- (mlines, mcols) = self.win.getmaxyx()
+ (_, mcols) = self.win.getmaxyx()
self.main_panel.bottom()
self.win.clear()
+
# If on the back of the card, show the content of the front side in
# the header
num_done = str(self.obj.index + 1).zfill(len(str(len(self.stack))))
+ str(self.current_card().front)
+ '"'
)
+
header_width = mcols
if mcols > 80:
header_width = 80
width=self.wrap_width(),
),
)
- self.update_panels()
+
self.disp_bar()
self.disp_sidebar()
(mlines, mcols) = self.win.getmaxyx()
left = mcols - 19
- for i in range(20):
- self.win.addch(0, mcols - 20 + i, " ")
-
self.win.addstr(
0,
mcols - 16,