update Menu module with widgets.

This commit is contained in:
Glenn Y. Rolland 2008-02-28 17:50:56 +01:00
parent e49f40e5e2
commit 69126b14dd

41
Menu.ml
View file

@ -1,16 +1,37 @@
(* position are not absolutes, but percentage *)
(* vim: set ts=2 sw=2 et : *)
type text_t = {
position: Position.t;
font: string;
font_size: int;
};;
type image_t = {
position: Position.t;
};;
type hover_t = {
action: unit -> unit ;
};;
type widget_t = type widget_t =
| Menu_text of string | Menu_text of text_t
| Menu_image of | Menu_image of string * Position.t * Position.t
| Menu_clickable | Menu_clickable of Position.t * Position.t
| Menu_hover of string
;; ;;
type menu_t = { (* Menu.t *)
widgets : widget_t list ; type t = {
click_handle : Position.position_t -> unit ; widgets : widget_t list ;
keyboard_handle : string (* Keyboard.a *) click_handle : Position.t -> unit ;
keyboard_handle : string (* Keyboard.a *)
};;
;; let handle_event ev =
let actions = (Mouse.handle_event ev) :: (Mouse.handle_event ev)
let handle_click pos = in
actions;;