Callback functions : reshape, idle, timer, redisplay, mouse, keyboard, NULL
Menus : create menu, set menu, add entry, attach menu, add sub menu
Subwindows, multiple windows : create & destroy a window, create subwindows
Make the following modifications to Assignment 1:
Enable double buffering.
Place an ellipse in a SubWindow of the main window. Set the sub-window's display function to draw the background a different color.
Create a menu on the sub window only that allows the user to change the subwindow's background color.
Make the circle and triangle appear in a separate window entitled “window 2”. When this window is resized, its size should be drawn to the lower left hand corner of the window.
Alter the main window so that if a user clicks on it with the left click button, a new circle, with a random color, appears where they clicked.
Animate the shapes using the idle or timer function as follows:
Make the squares rotate counter clockwise.
Make the triangle rotate clockwise.
Make the circles increase in size and then decrease in size as though it was “breathing”.
Create a menu for the main window that is right-click activated with the following layout:
Square Colors ->
Where each button does the indicated action.Movie of HW2 in action
Last modified January 21, 2010.