Skip to content

Instantly share code, notes, and snippets.

@camlspotter
Created March 4, 2014 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camlspotter/9347554 to your computer and use it in GitHub Desktop.
Save camlspotter/9347554 to your computer and use it in GitHub Desktop.
let () =
prerr_endline @@ GMain.Main.init ();
let window = GWindow.window ~title: "liv" ~allow_shrink: true ~allow_grow: true () in
window#show ();
window#event#add [`SCROLL];
ignore @@ window#event#connect#scroll ~callback:(fun ev ->
Printf.eprintf "at +%.0f+%.0f %s\n%!"
(GdkEvent.Scroll.x ev)
(GdkEvent.Scroll.y ev)
(match GdkEvent.Scroll.direction ev with
| `UP -> "up"
| `DOWN -> "down"
| `LEFT -> "left"
| `RIGHT -> "right");
false);
GMain.Main.main ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment