Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lab 12 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.

Similar presentations


Presentation on theme: "Lab 12 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show."— Presentation transcript:

1 Lab 12 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show me the result after you finish all the tasks. Make-Up Policies: If you cannot finish the drill in the lab, you can go back to work on it. You can send me (including result screenshot and source code) or show me in next lab.

2 Drill Write a program to display a window with a circle representing a light bulb and a button labelled "ON/OFF".  The light bulb starts off black, i.e., off.  When the button is clicked, the light bulb turns on, i.e., white.  When the button is clicked again, the light goes off, and so on.

3 Drill Hints: Start with the program in section 16.5, remove all the graphical objects except for one button, then add the light bulb. To make the light toggle between on and off, you could use a flag bool light_on = false; and make the button's callback do  light_on = !light_on; to toggle it. When you change the fill color, be sure to redraw the window.


Download ppt "Lab 12 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show."

Similar presentations


Ads by Google