typedef control checkbox; typedef void (*actionfn)(button b);
checkbox newimagecheckbox(image img, rect r, actionfn fn); void setimage(checkbox c, image img);
The newimagecheckbox function creates a checkbox control, which has the specified image drawn within it. The checkbox will appear on the last window which was created.
When the user clicks on the checkbox with the mouse, the specified action function fn is called, and the image will be drawn in a 'darkended' state. Clicking the button again will reverse this effect. The parameter to the action function will be the checkbox which called the function.
If the checkbox is diabled, an algorithm is used to generate a 'greyed out' image based on the original image.
To change the image used by a checkbox, call setimage.