csc374And407_lect09 - CSC 374/407 Computer Systems II...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 374/407: Computer Systems II Lecture 9 Joseph Phillips De Paul University 2016 September 6 Copyright © 2012-2016 Joseph Phillips All rights reserved
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Overview What is ncurses? A text-package that lets you control text on the screen
Image of page 2
ncurses “curses” (circa 1980) A screen package for BSD Unix from U.C. Berkeley “ncurses” (1993) For “ n ew curses BIG IDEA: Two screens Virtual one written to by program Physical one (user's terminal) Package minimizes bandwidth by Relying on programmer to refresh() to sync screens Only sending over minimal number of changes needed
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Our first ncurses program:
Image of page 4
Our first ncurses program, cont'd
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ncurses functions (1) initscr() Starts ncurses package clear() Clears screen move(int row, int col) Moves cursor to given row and col (upper left is 0,0) addstr(const char* str) Write string pointed to by str to current location addch(char c) Writes character c to current location refresh() Sends changes need to write virtual screen to physical endwin() Ends ncurses package
Image of page 6
Subwindows Type WINDOW* refers to a window stdscr refers to the whole window Can define subwindows of whole screen
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
subwindows.c
Image of page 8
subwindow.c, cont'd
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern