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

Info icon This 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 ring2 We’ve seen how the cwin function can output shapes and text, e.g. cwin << my_circle; ring2 The cwin function can also be used to get different kinds of input from the graphics windows. circle6 Text circle6 Numbers circle6 Mouse clicks ring2 Use the member functions cwin.function( ) ring2 The syntax cwin >> does not work. ring2 The input prompt and response is shown in a box at the top of the window.
Image of page 1

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

View Full Document Right Arrow Icon
2 Getting Text: get_string ring2 cwin has a member function get_string that can grab a text string from the user. ring2 Pass the function a string to display. Prompts the user for input. ring2 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: "); ring2 The prompt and user input appears at the top of the graphics window. We can’t move it. ring2 If you want text inside the window, use Message class.
Image of page 2
Image of page 3
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