ImageButtons

OBJECTS

  typedef control  button;

  typedef void (*actionfn)(button b);

FUNCTIONS

  button  newimagebutton(image img, rect r, actionfn fn);
  void    setimage(button b, image img);

NOTES

The newimagebutton function creates a push-button control, which has the specified image drawn within it. The button will appear on the last window which was created.

When the user clicks on the button with the mouse, the specified action function fn is called. The parameter to this action function will be the button which called the function.

If the button is diabled, an algorithm is used to generate a 'greyed out' image based on the original image.

To change the image used by a button, call setimage.