type gr_list =
{ li_window : gr_window
; mutable li_left : int
; mutable li_top : int
; mutable li_width : int
; mutable li_height : int
; mutable li_nu_item : int
; mutable li_1st_item : int
; mutable li_items : string vect
; mutable li_callback : gr_list -> event -> bool
; mutable li_scroll : int
}
;;
The list is a string list. One string is selected
(surrounded), and a scrollbar is used to shift the displayed part.
The variables in the type gr_list are:
- the attached window (li_window),
- the lower left corner (li_left,li_top),
- the width (li_width),
- the height (li_height),
- the number of the selected line (li_nu_item),
- the number of the first displayed line (li_1st_item),
- the position of the scrollbar (li_scroll),
- the callback function, called when the selected line is changed
(li_callback),
- the list of lines (li_items).
The functions linked with the type gr_list are:
gr_draw_list : gr_list -> unit
- gr_draw_list Lst draws the list Lst.
gr_list_managed : gr_list -> event -> bool
- this is the function used by Camlwin to manage the list
objects.
gr_list_add_item : gr_list -> string -> int -> unit
- gr_list_add_item Lst Str n adds a line Str in the list object
Lst at line number n.
gr_list_del_item : gr_list -> int -> unit
- gr_list_del_item Lst n deletes the nth. line of the list object
Lst.
gr_list_sort : gr_list -> unit
- gr_list_sort Lst sorts the line of the list object Lst.