type gr_user =
{ us_window : gr_window
; mutable us_param : melted_type vect
; mutable us_draw : gr_user -> unit
; mutable us_callback : gr_user -> event -> bool
}
;;
The last Camlwin graphics object is not built on the same
model as the others. The drawing function is not distinct and fixed
but linked to the defined object and defined by the programmer, in
the same way as the management function. These objects have the type
gr_user. This type is composed of:
- the attached window (us_window),
- the list of parameters (us_param), each parameter can be a
string, an integer, a bitmap or a boolean. The programmer defines
a meaning for each paramater and uses them to manage and draw
the object,
- the drawing function, that takes a defined object as
parameter (us_draw),
- the function that manages the object (us_callback). This
function is called each time the place of a button_down,
button_up or keypressed event occur in window.
Basically, the first two elements of the vector
us_param are of type int_type and define the coordinates of upper left
corner.