whoa
This commit is contained in:
73
oplevel.ml
73
oplevel.ml
@ -152,43 +152,58 @@ let main =
|
||||
(String "#use \"topfind\";;\n#list;;#require \"lwt\";;")); *)
|
||||
(* toplevel execution binding *)
|
||||
Ui.(
|
||||
update_bindings ui
|
||||
Event.(
|
||||
fun a ->
|
||||
a
|
||||
|> adds
|
||||
[
|
||||
[
|
||||
Key (Press, X, [ Control ]);
|
||||
Key (Press, E, [ Control ]);
|
||||
];
|
||||
]
|
||||
[
|
||||
Custom
|
||||
( "toplevel_execute",
|
||||
fun () ->
|
||||
TextBuffer.peek tb_init >>= fun _str ->
|
||||
(*Toploop.use_input out_ppf (String str)
|
||||
|> F.epr "Toploop.use_input=%b@."; *)
|
||||
Lwt.return_unit );
|
||||
]));
|
||||
append_bindings ui
|
||||
(Lwd.return
|
||||
Event.
|
||||
[
|
||||
pack Fun.id
|
||||
(empty
|
||||
|> adds
|
||||
[
|
||||
[
|
||||
Key (Press, X, [ Control ]);
|
||||
Key (Press, E, [ Control ]);
|
||||
];
|
||||
]
|
||||
[
|
||||
Custom
|
||||
( "toplevel_execute",
|
||||
fun () ->
|
||||
TextBuffer.peek tb_init >>= fun _str ->
|
||||
(*Toploop.use_input out_ppf (String str)
|
||||
|> F.epr "Toploop.use_input=%b@."; *)
|
||||
Lwt.return_unit );
|
||||
]);
|
||||
]));
|
||||
|
||||
WindowManager.make ui
|
||||
(Lwd.var
|
||||
(`T
|
||||
( `Y,
|
||||
[
|
||||
(`TextEdit (TextEdit.multiline ui to_init), `Ratio 0.333);
|
||||
(`TextEdit (TextEdit.multiline ui tb_init), `Ratio 0.5);
|
||||
(`TextEdit (TextEdit.multiline ui to_init), `Ratio 1.0);
|
||||
] )))
|
||||
WindowManager.
|
||||
[
|
||||
{
|
||||
t = `TextEdit (TextEdit.multiline ui to_init);
|
||||
dim = `Ratio 0.333;
|
||||
bindings = [];
|
||||
};
|
||||
{
|
||||
t = `TextEdit (TextEdit.multiline ui tb_init);
|
||||
dim = `Ratio 0.5;
|
||||
bindings = [];
|
||||
};
|
||||
{
|
||||
t = `TextEdit (TextEdit.multiline ui to_init);
|
||||
dim = `Ratio 1.0;
|
||||
bindings = [];
|
||||
};
|
||||
] )))
|
||||
>>= fun page ->
|
||||
let page_root = Lwd.observe page in
|
||||
|
||||
let bindings =
|
||||
ui.bindings |> Lwd.get |> Lwd.observe |> Lwd.quick_sample |> snd
|
||||
in
|
||||
F.epr "Bindings:@.%a" Ui.pp_bindings bindings;
|
||||
let bindings = ui.bindings |> Lwd.observe |> Lwd.quick_sample in
|
||||
F.epr "Bindings:@.";
|
||||
List.iter (fun bs -> F.epr "%a" Ui.pp_pack bs) bindings;
|
||||
|
||||
F.pr "oplevel.ml: entering drawing loop@.";
|
||||
let period_min = 1.0 /. 30. in
|
||||
|
||||
Reference in New Issue
Block a user