]> git.mdlowis.com Git - archive/tide-ocaml.git/commitdiff
prototyped drawing a cursor
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 12 Sep 2017 20:25:47 +0000 (16:25 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 12 Sep 2017 20:25:47 +0000 (16:25 -0400)
edit.ml
lib/x11.ml

diff --git a/edit.ml b/edit.ml
index 203c28057f715301ad8d36f5a902513b259cc712..6b19d41b5d276a06da45c0ede79ac2250d44beff 100644 (file)
--- a/edit.ml
+++ b/edit.ml
@@ -1,6 +1,7 @@
 open X11
 
-let font = font_load "Times New Roman:size=12"
+(*let font = font_load "Times New Roman:pixelsize=14"*)
+let font = font_load "Liberation Mono:pixelsize=14"
 
 let onfocus focused =
   print_endline "onfocus"
@@ -16,8 +17,10 @@ let onmousemove mods x y =
 
 let onupdate width height =
   Printf.printf "onupdate: %d %d\n" width height;
-  draw_rect { x = 0; y = 0; w = width; h = height; c = Cfg.Color.palette.(0) };
-  draw_string font Cfg.Color.palette.(5) "FooBarBaz" (0,0);
+  draw_rect { x = 2; y = 2; w = width; h = height; c = Cfg.Color.palette.(0) };
+  draw_string font Cfg.Color.palette.(5) "FooBarBaz\tYay\r\n" (2,2);
+  draw_string font Cfg.Color.palette.(5) "FooBarBaz\tYay\r\n" (2,2+font.height);
+  draw_rect { x = 2; y = 2; w = 1; h = font.height; c = Cfg.Color.palette.(3) };
   flip ()
 
 let onshutdown () =
index 6b4360357ce651fc9ae3d1d009e0789dd0d30254..ebbabe21882af362b04f9e6df83a9deb4ec4e69d 100644 (file)
@@ -34,14 +34,12 @@ type xcfgvar =
   | String of string
   | NotSet
 
-type font =
-  | NoFont
-  | Font of {
-    font: xfont;
-    patt: xfontpatt;
-    height: int;
-    next: font;
-  }
+type font = {
+  font: xfont;
+  patt: xfontpatt;
+  height: int;
+  next: font;
+}
 
 type glyph = {
   font: xfont;