A checkbox is created with a call to the class constructor
GLUI_CheckBox
The constructor has five parameters, with the first two being the pointer to the panel containing the box and a string that labels the box. Similar to creating the spinner box, we pass NULL as the third parameter. The fourth parameter is the id for the element which is passed to our handler. Since we do not need an identifier for this GLUI element, we set the parameter to -1. Last, the fifth parameter is the name (address) of our handler for this element.
We create a GLUI button with a call to the function
add_button_to_panel
The function requires the following four parameters. The first parameter is the pointer to the panel where we are adding the button -- mainPanel for our example. The second parameter is a string that appears on the button -- "Close Program" is used here since that is the purpose of our button. The third parameter is an integer that serves as the identifier for the button and is passed to the button callback handler. The fourth and last parameter is the name of (address of) our button handler.