Slide 12
Slide 12 text
Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 12
jgs
Example 2
// https://github.com/javiergs/SER332/blob/master/Lecture10/ScreenShot%20example_two.png
void createMenus() {
//add entries to submenu Colores
int menuA = glutCreateMenu(menuListener);
glutAddMenuEntry("Red", 1);
glutAddMenuEntry("Blue", 2);
glutAddMenuEntry("Green", 3);
glutAddMenuEntry("White", 4);
//add entries to submenu Position
int menuB = glutCreateMenu(menuListener);
glutAddMenuEntry("Top", 5);
glutAddMenuEntry("Center", 6);
glutAddMenuEntry("Down", 7);
// create main menu
int menu = glutCreateMenu(menuListener);
glutAddSubMenu("Colores", menuA);
glutAddSubMenu("Position", menuB);
// attach the menu to the right button
glutAttachMenu(GLUT_RIGHT_BUTTON);
}
void myInit() {
createMenus();