def setup_draw(self):
# get screen dimensions
self.maxY, self.maxX = self.stdscr.getmaxyx()
# n_lines, n_cols, begin_y, begin_x
self.head_win = curses.newwin(1, self.maxX, 0, 0)
# left panel, contacts
self.body_win = curses.newwin(
self.maxY - 1,
int(self.maxX * self.body_proportion),
1,
0)
# chat frame
self.chat_win = curses.newwin(
self.maxY - 1 - int(self.maxY * self.text_area_proportion),
self.maxX - int(self.maxX * self.body_proportion),
1,
int(self.maxX * self.body_proportion))
# chat window (displays text)
self.chatarea = curses.newwin(
self.maxY - 1 - int(self.maxY * self.text_area_proportion) - 2,
self.maxX - int(self.maxX * self.body_proportion) - 2,
2,
int(self.maxX * self.body_proportion) + 1)
# bottom frame window
self.text_win = curses.newwin(
int(self.maxY * self.text_area_proportion),
self.maxX - int(self.maxX * self.body_proportion),
self.maxY - int(self.maxY * self.text_area_proportion),
int(self.maxX * self.body_proportion))
# bottom textarea
self.textarea = curses.newwin(
int(self.maxY * self.text_area_proportion) - 2,
self.maxX - int(self.maxX * self.body_proportion) - 2,
self.maxY - int(self.maxY * self.text_area_proportion) + 1,
int(self.maxX * self.body_proportion) + 1)
self.init_head()
self.init_body()
self.init_chat()
self.init_chatarea()
self.init_textbox()
self.init_textarea()
self.body_win.keypad(1)
curses.doupdate()
评论列表
文章目录