Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Curses Difference between newwin and subwin

i don't seem to be able to find any informations about the difference between curses.newwin and curses.subwin

do you know any?

i'd like to have a screen divided in 3 different sections with different updates times (not everything must be updated every keypress). is this the correct direction to go?

thank you

like image 559
Stormsson Avatar asked Jan 07 '13 16:01

Stormsson


1 Answers

Docu not for Python, but could help you.

Calling newwin() creates and returns a pointer to a new window with the given number of lines and columns. The upper left-hand corner of the window is at line begin_y, column begin_x. If either nlines or ncols is zero, they default to LINES-begin_y and COLS-begin_x. A new full-screen window is created by calling newwin(0,0,0,0).

Calling subwin() creates and returns a pointer to a new window with the given number of lines, nlines, and columns, ncols. The window is at position (begin_y, begin_x) on the screen. (This position is relative to the screen, and not to the window orig.) The window is made in the middle of the window orig, so that changes made to one window will affect both windows. The subwindow shares memory with the window orig. When using this routine, it is necessary to call touchwin() or touchline() on orig before calling wrefresh() on the subwindow.

http://www.mkssoftware.com/docs/man3/curs_window.3.asp

like image 173
Kiwisauce Avatar answered Sep 29 '22 19:09

Kiwisauce