From 875b12b4a0c49f7bc0ae3ba6c4a0b842f2a8653f Mon Sep 17 00:00:00 2001 From: faiface Date: Tue, 7 May 2019 01:18:17 +0200 Subject: correctly document the resize event --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index eadc8a4..e2d906c 100644 --- a/README.md +++ b/README.md @@ -91,8 +91,8 @@ Examples of `Event` strings are: `"wi/close"`, `"mo/move/104/320"`, `"kb/type/71 ```go switch { -case event.Matches("resize/%d/%d", &w, &h): - // environment resized to (w, h) +case event.Matches("resize/%d/%d/%d/%d", &x0, &y0, &x1, &y1): + // environment resized to (x0, y0, x1, y1) case event.Matches("wi/close"): // window closed case event.Matches("mo/move/%d/%d", &x, &y): @@ -116,7 +116,7 @@ case event.Matches("kb/repeat/%s", &key): This shows all the possible events that a window can produce. You can find a little more info (especially on the keys) [here in GoDoc](https://godoc.org/github.com/faiface/gui/win#Win). -The `"resize"` event is not prefixed with `"wi/"`, because it's not specific to windows. +The `"resize"` event is not prefixed with `"wi/"`, because it's not specific to windows. It is also guaranteed to be the first event produced by any `Env`. You can also match only specific buttons/keys, or ignore them: -- cgit v1.2.3