예제 #1
0
파일: accel.go 프로젝트: twstrike/gotk3
// AccelGroupFromClosure is a wrapper around gtk_accel_group_from_accel_closure().
func AccelGroupFromClosure(f interface{}) *AccelGroup {
	closure, _ := glib.ClosureNew(f)
	cl := (*C.struct__GClosure)(unsafe.Pointer(closure))
	c := C.gtk_accel_group_from_accel_closure(cl)
	if c == nil {
		return nil
	}
	return wrapAccelGroup(wrapObject(unsafe.Pointer(c)))
}
예제 #2
0
파일: accel.go 프로젝트: twstrike/gotk3
// Connect is a wrapper around gtk_accel_group_connect().
func (v *AccelGroup) Connect(key uint, mods gdk.ModifierType, flags AccelFlags, f interface{}) {
	closure, _ := glib.ClosureNew(f)
	cl := (*C.struct__GClosure)(unsafe.Pointer(closure))
	C.gtk_accel_group_connect(
		v.native(),
		C.guint(key),
		C.GdkModifierType(mods),
		C.GtkAccelFlags(flags),
		cl)
}
예제 #3
0
파일: accel.go 프로젝트: twstrike/gotk3
// ConnectByPath is a wrapper around gtk_accel_group_connect_by_path().
func (v *AccelGroup) ConnectByPath(path string, f interface{}) {
	closure, _ := glib.ClosureNew(f)
	cl := (*C.struct__GClosure)(unsafe.Pointer(closure))

	cstr := C.CString(path)
	defer C.free(unsafe.Pointer(cstr))

	C.gtk_accel_group_connect_by_path(
		v.native(),
		(*C.gchar)(cstr),
		cl)
}
예제 #4
0
파일: accel.go 프로젝트: twstrike/gotk3
// Disconnect is a wrapper around gtk_accel_group_disconnect().
func (v *AccelGroup) Disconnect(f interface{}) {
	closure, _ := glib.ClosureNew(f)
	cl := (*C.struct__GClosure)(unsafe.Pointer(closure))
	C.gtk_accel_group_disconnect(v.native(), cl)
}