예제 #1
0
파일: shortcuts.go 프로젝트: PMaynard/coyim
func connectShortcut(accel string, w *gtk.Window, action func(*gtk.Window)) {
	g, _ := gtk.AccelGroupNew()
	key, mod := gtk.AcceleratorParse(accel)

	// Do not remove the closure here - there is a limitation
	// in gtk that makes it necessary to have different functions for different accelerator groups
	g.Connect(key, mod, gtk.ACCEL_VISIBLE, func() {
		action(w)
	})

	w.AddAccelGroup(g)
}
예제 #2
0
파일: real_gtk.go 프로젝트: twstrike/coyim
func (*RealGtk) AcceleratorParse(acc string) (uint, gdki.ModifierType) {
	res, res2 := gtk.AcceleratorParse(acc)
	return res, gdki.ModifierType(res2)
}