Lec7 - Lecture 7: More Graphics PIC 10A Todd Wittman Sec...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Lecture 7: More Graphics PIC 10A Todd Wittman Sec 3.7 : Graphics Window Input r We’ve seen how the cwin function can output shapes and text, e.g. cwin << my_circle; r The cwin function can also be used to get different kinds of input from the graphics windows. c Text c Numbers c Mouse clicks r Use the member functions cwin.function( ) r The syntax cwin >> does not work. r The input prompt and response is shown in a box at the top of the window.
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Getting Text: get_string r cwin has a member function get_string that can grab a text string from the user. r Pass the function a string to display. Prompts the user for input. r Returns a string. Since ccc_win uses the <string> library, we don’t need to include it to use strings. string name = cwin.get_string("Enter text: "); r The prompt and user input appears at the top of the graphics window. We can’t move it. r If you want text inside the window, use Message class. Getting Numbers: get_double
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

Lec7 - Lecture 7: More Graphics PIC 10A Todd Wittman Sec...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online