Exemple #1
0
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)
}
Exemple #2
0
func (*RealGtk) AccelGroupNew() (gtki.AccelGroup, error) {
	return wrapAccelGroup(gtk.AccelGroupNew())
}