Skip to content

Commit

Permalink
curses: Added colors to the login windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Kjir committed Apr 7, 2009
1 parent 8fc791b commit 052c633
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion amsn2/gui/front_ends/curses/login.py
Expand Up @@ -5,6 +5,7 @@
class TextBox(object):
def __init__(self, win, y, x, txt):
self._win = win.derwin(1, 30, y, x)
self._win.bkgd(' ', curses.color_pair(0))
self._win.clear()
self._txtbox = curses.textpad.Textbox(self._win)
self._txtbox.stripspaces = True
Expand Down Expand Up @@ -63,7 +64,7 @@ def __init__(self, amsn_core, parent):

def show(self):
self._win.border()
self._win.standout()
self._win.bkgd(' ', curses.color_pair(1))
self._win.addstr(5, 5, "Account : ", curses.A_BOLD)
self._username_t = TextBox(self._win, 5, 17, self._username)

Expand Down
7 changes: 6 additions & 1 deletion amsn2/gui/front_ends/curses/main.py
Expand Up @@ -8,7 +8,7 @@ def __init__(self, amsn_core):

def show(self):
self._stdscr = curses.initscr()
curses.start_color()
self.__init_colors()
curses.noecho()
curses.cbreak()
self._stdscr.keypad(1)
Expand All @@ -31,3 +31,8 @@ def setTitle(self,title):
def setMenu(self,menu):
pass

def __init_colors(self):
curses.start_color()
curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_WHITE)
curses.init_pair(1, curses.COLOR_YELLOW, curses.COLOR_WHITE)

0 comments on commit 052c633

Please sign in to comment.