mirror of
https://github.com/python/cpython.git
synced 2025-10-18 04:38:07 +00:00
Update this demo to use curses.panel
This commit is contained in:
parent
48f224c877
commit
72a18a6659
1 changed files with 3 additions and 2 deletions
|
@ -6,6 +6,7 @@
|
||||||
# module. Currently, only the panel demos are ported.
|
# module. Currently, only the panel demos are ported.
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
|
from curses import panel
|
||||||
|
|
||||||
def wGetchar(win = None):
|
def wGetchar(win = None):
|
||||||
if win == None: win = stdscr
|
if win == None: win = stdscr
|
||||||
|
@ -30,7 +31,7 @@ def saywhat(text):
|
||||||
|
|
||||||
def mkpanel(color, rows, cols, tly, tlx):
|
def mkpanel(color, rows, cols, tly, tlx):
|
||||||
win = curses.newwin(rows, cols, tly, tlx)
|
win = curses.newwin(rows, cols, tly, tlx)
|
||||||
pan = win.new_panel()
|
pan = panel.new_panel(win)
|
||||||
if curses.has_colors():
|
if curses.has_colors():
|
||||||
if color == curses.COLOR_BLUE:
|
if color == curses.COLOR_BLUE:
|
||||||
fg = curses.COLOR_WHITE
|
fg = curses.COLOR_WHITE
|
||||||
|
@ -45,7 +46,7 @@ def mkpanel(color, rows, cols, tly, tlx):
|
||||||
return pan
|
return pan
|
||||||
|
|
||||||
def pflush():
|
def pflush():
|
||||||
curses.update_panels()
|
panel.update_panels()
|
||||||
curses.doupdate()
|
curses.doupdate()
|
||||||
|
|
||||||
def fill_panel(pan):
|
def fill_panel(pan):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue