Skip to content

Instantly share code, notes, and snippets.

@camlspotter
Created June 29, 2022 02:31
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/255ef887457ff9f75b875171dccc31c8 to your computer and use it in GitHub Desktop.
Save camlspotter/255ef887457ff9f75b875171dccc31c8 to your computer and use it in GitHub Desktop.
Small program to detect window resize
let () =
ignore @@ GMain.Main.init ();
let window = GWindow.window ~width:100 ~height:100 () in
ignore @@ window#event#connect#configure ~callback:(fun ev ->
let open GdkEvent.Configure in
prerr_endline (Printf.sprintf "Configure %dx%d+%d+%d"
(width ev)
(height ev)
(x ev)
(y ev));
false);
window#show ();
GMain.Main.main ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment