Created
March 4, 2014 14:34
-
-
Save camlspotter/9347554 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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