ASSIGNMENT #2: Circles
Score: 10 points
Bonus: 2 points (see below)
Due date: 9/15/06
I hope you remember the circle program, demonstrated in class on Wednesday. If not, here's a
picture that should give you the idea:
Your task: Make some changes to understand the underlying event structure !
You will get the source code of the original program. Compile it, run it, make sure everything's fine.
Play around with it, so you get an idea what's happening. That's just to warm up. The real task
description comes here (the description order is not necessarily the order you should work on the assignment,
please read the full description first and make sure you understood):
- Change the frame in a way that it only shows a single circle + button (that's simple)
- The button should not switch the circle on/off, but toggle its color between... whatever 2 colors you want.
- Show 10 of these frames (each containing a single circle and its button). Make them simply single, independent
frames, not to be put together in any layout of a container frame.
- Create another window, containing just a button. This button should work as the master toggle button, it
should toggle the colors of all circles.
If you want 2 Bonus points, here comes the extended version !
- Let the extra window not only contain a button, but also a slider. The slider should control the size of all circles.
The source code is HERE !
Some hints:
- The control window, i.e. the frame containing the master-button (and maybe a slider), is a good place for the main
program.
-
Please attend Aubrey's Lab tomorrow, Sept. 8, at 2:00. He'll explain the basics of using graphical user interfaces. Without that you might
feel a bit lost with this assignment. The class on Monday will also go into graphics programming, and finally everything will be clear to you !
Good luck and have fun !