3.5) The buttons.

type melted_type = 
                   string_type of string
                 | int_type of int
                 | bitmap_type of image
                 | float_type of float
                 | bool_type of bool
;;
melted_type defines a general type that can be used in many places. It is the union of the classical type: string, int, boolean, and bitmap (image defined in the windows library). This type is used here to define the contents of the buttons.
type button_state =
    Up
  | Down
  | Unused
;;
type gr_button =
  { bt_window : gr_window
  ; mutable bt_top : int
  ; mutable bt_left : int
  ; mutable bt_width : int
  ; mutable bt_height : int
  ; mutable bt_name : melted_type
  ; mutable bt_state : button_state
  ; mutable bt_callback : gr_button -> event -> bool
  }
;;
gr_button defines a button. The callback function is only called when the user presses and releases the mouse button inside the defined draw button. The sum type stores all the variables needed to define a button. This variables are: The other functions linked with the buttons are:
gr_draw_button : gr_button -> unit
gr_draw_button Button draws the button Button.
gr_draw_unfilled_button : gr_button -> unit
gr_draw_unfilled_button Button draws only the outline of the button Button.
gr_button_managed : gr_button -> event -> bool
its the function used by Camlwin to manage the buttons.