storeview

This commit is contained in:
cqc
2021-10-29 12:27:58 -05:00
parent 364e3e7165
commit 983fc326d6
2 changed files with 308 additions and 323 deletions

View File

@ -514,12 +514,25 @@ module Display = struct
get_events () @ [Event.event_of_sdlevent ev]
else []
let successful_actor = ref (fun _ -> Lwt.return pane_empty)
let display_frame frame (actor : actor) =
let events = get_events () in
handle_frame_events frame events ;
if List.length events > 0 then (
(* recompute the actor definition with the new events to return a new pane *)
!actor events
( try
!actor events
>|= fun p ->
successful_actor := !actor ;
p
with e ->
F.epr
"Display.display_frame (!actor events) failed with:@. %s \
@."
(Printexc.to_string e) ;
actor := !successful_actor ;
!actor events )
>>= fun p ->
frame.last_pane <- p ;
(* call draw_pane because we should redraw now that we have updated *)
@ -1118,7 +1131,6 @@ module Panel = struct
module Nottui = struct
open Nottui
open Notty
module P = Nottui_pretty
let convert_events events : Nottui_lwt.event option list =
@ -1227,8 +1239,6 @@ module Panel = struct
| _, _, _ -> "fonts/Roboto-Regular.ttf" ) )
end
open Notty
let invalid_arg fmt = Format.kasprintf invalid_arg fmt
let ( &. ) f g x = f (g x)
let btw (x : int) a b = a <= x && x <= b