We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f08e1e commit bb9eb76Copy full SHA for bb9eb76
main.go
@@ -57,10 +57,18 @@ func setupWindow(title string) *gtk.Window {
57
win.Connect("destroy", func() {
58
gtk.MainQuit()
59
})
60
+ // quit on out blur
61
win.Connect("focus-out-event", func(widget *gtk.Window, event *gdk.Event) bool {
62
63
return false // Continue with the default behavior
64
65
+ // quit on press ESC
66
+ win.Connect("key-press-event", func(window *gtk.Window, event *gdk.Event) {
67
+ keyEvent := &gdk.EventKey{Event: event}
68
+ if keyEvent.KeyVal() == gdk.KEY_Escape {
69
+ gtk.MainQuit()
70
+ }
71
+ })
72
73
// vertical button box
74
mainBox, err := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 2)
0 commit comments