.Ds .Fd delwin win WINDOW *win; .De Deletes the window from existence. All resources are freed for future use by .Fn calloc , .Fn cfree , etc. If a window has a .Fn subwin allocated window inside of it, deleting the outer window the subwindow is not affected, even though this does invalidate it. Therefore, subwindows should be deleted before their outer windows are. .Ds .Fd endwin .De Finish up window routines before exit. This restores the terminal to the state it was before .Fn initscr (or .Fn gettmode and .Fn setterm ) was called. It should always be called before exiting. It does not exit. This is especially useful for resetting tty stats when trapping rubouts via .Fn signal . .Ds .Fd getyx win\*,y\*,x \*m WINDOW *win; int y\*,x; .De Puts the current \*y of .Vn win in the variables .Vn y and .Vn x . Since it is a macro, not a function, you do not pass the address of .Vn y and .Vn x . .Ds .Fd inch "" \*m .Fd winch win \*m WINDOW *win; .De Returns the character at the current \*(y on the given window. This does not make any changes to the window. \*(Nm .Ds .Fd initscr .De Initialize the screen routines. This must be called before any of the screen routines are used. It initializes the terminal-type data and such, and without it, none of the routines can operate. If standard input is not a tty, it sets the specifications to the terminal whose name is pointed to by .Vn Def\*_term (initialy "dumb"). If the boolean .Vn My\*_term is true, .Vn Def\*_term is always used. .Ds .Fd leaveok win\*,boolf \*m WINDOW *win; bool boolf; .De Sets the boolean flag for leaving the cursor after the last change. If .Vn boolf is TRUE, the cursor will be left after the last update on the terminal, and the current \*y for .Vn win will be changed accordingly. If it is FALSE, it will be moved to the current \*y. This flag (initialy FALSE) retains its value until changed by the user. .Ds .Fd longname termbuf\*,name char *termbuf\*,*name; .De Fills in .Vn name with the long (full) name of the terminal described by the termcap entry in .Vn termbuf . It is generally of little use, but is nice for telling the user in a readable format what terminal we think he has. This is available in the global variable .Vn ttytype . .Vn Termbuf is usually set via the termlib routine .Fn tgetent . .Ds .Fd mvwin win\*,y\*,x WINDOW *win; int y, x; .De Move the position of the window .Vn win from its current starting coordinates to .Fn y\*,x ). ( If it does not fit at that position, .Fn mvwin returns ERR and does not change anything .Ds .Fd newwin lines\*,cols\*,begin\*_y\*,begin\*_x "" "WINDOW *" int lines\*,cols\*,begin\*_y\*,begin\*_x; .De Create a new window with .Vn lines lines and .Vn cols columns starting at position .Vn begin\*_y\*,begin\*_x ). ( If either .Vn lines or .Vn cols is 0 (zero), that dimension will be set to .Vn "LINES \- begin\*_y" ) ( or .Vn "COLS \- begin\*_x" ) ( respectively. Thus, to get a new window of dimensions .Vn LINES \(mu .Vn COLS , use .Fn newwin . "" 0\*,0\*,0\*,0 .Ds .Fd nl "" \*m .Fd nonl "" \*m .De Set or unset the terminal to/from nl mode, i.e., start/stop the system from mapping .b <RETURN> to .b <LINE-FEED> . If the mapping is not done, .Fn refresh can do more optimization, so it is recommended, but not required, to turn it off. .Ds .Fd scroll win WINDOW *win; .De Scroll the window upward one line. This is normally not used by the user. .Ds .Fd scrollok win\*,boolf \*m WINDOW *win; bool boolf; .De Set the scroll flag for the given window. If .Vn boolf is FALSE, scrolling is not allowed. This is its default setting. .Ds .Fd touchwin win WINDOW *win; .De Make it appear that the every location on the window has been changed. This is only needed for refreshes with overlapping windows. .Ds .Fd subwin win\*,lines\*,cols\*,begin\*_y\*,begin\*_x "" "WINDOW *" WINDOW *win; int lines\*,cols\*,begin\*_y\*,begin\*_x; .De Create a new window with .Vn lines lines and .Vn cols columns starting at position .Vn begin\*_y\*,begin\*_x ) ( .i "in the middle of the window" win. This means that any change made to either window in the area covered by the subwindow will be made on both windows. .Vn begin\*_y\*,begin\*_x are specified relative to the overall screen, not the relative (0\*,0) of .Vn win . If either .Vn lines or .Vn cols is 0 (zero), that dimension will be set to .Vn "LINES \- begin\*_y" ) ( or .Vn "COLS \- begin\*_x" ) ( respectively. .Ds .Fd unctrl ch \*m char ch; .De This is actually a debug function for the library, but it is of general usefulness. It returns a string which is a representation of .Vn ch . Control characters become their lower-case equivalents preceded by a "^". Other letters stay just as they are. To use .Fn unctrl , you must have .b #include\ <unctrl.h> in your file.