-
Notifications
You must be signed in to change notification settings - Fork 1
/
event_screen.ml
51 lines (41 loc) · 1.49 KB
/
event_screen.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
open Lwt
open Lwt_react
open LTerm_widget
open Event
(* [in_frame w] is w wrapped in a frame *)
let in_frame w = let f = new frame in f#set w; f
let get_components e () =
let mainbox = new vbox in
let hbox = new hbox in
let descrp = new LTerm_widget.label (get_name e) in
mainbox#add ~expand:false(new spacing ~rows:15 ());
hbox#add descrp;
mainbox#add ~expand:false hbox;
mainbox#add ~expand:false (new hline);
mainbox#add ~expand:false(new spacing ~rows:1 ());
let result_string = ref "Yes" in
let group_string = new radiogroup in
let callback_string = function
| Some s -> result_string := s
| None -> ()
in
group_string#on_state_change callback_string;
let hbox = new hbox in
hbox#add ~expand:false (new spacing ~cols:60 ());
hbox#add (new radiobutton group_string (get_description e true) "Yes");
(*hbox#add (new spacing ~cols:20 ());*)
mainbox#add ~expand:false hbox;
let hbox = new hbox in
hbox#add ~expand:false (new spacing ~cols:60 ());
hbox#add (new radiobutton group_string (get_description e false) "No");
(*hbox#add (new spacing ~cols:20 ());*)
mainbox#add ~expand:false hbox;
mainbox#add ~expand:false(new spacing ~rows:1 ());
let hbox = new hbox in
let submit_button = new button ("Confirm") in
hbox#add (new spacing ~cols:20 ());
hbox#add ~expand:false (in_frame submit_button);
hbox#add (new spacing ~cols:20 ());
mainbox#add ~expand:false hbox;
mainbox#add ~expand:false (new hbox);
(mainbox, (submit_button, result_string));