示例#1
0
func app_indicator_new(id string, icon_name string, category int) AppIndicator {
	n := C.CString(id)
	defer C.free(unsafe.Pointer(n))
	k := C.CString(icon_name)
	defer C.free(unsafe.Pointer(k))
	return AppIndicator(C.app_indicator_new(n, k, (C.int)(category)))
}
示例#2
0
// Creates a new AppIndicator.
func NewAppIndicator(id, iconName string, category Category) *AppIndicator {
	idString := (*C.gchar)(unsafe.Pointer(C.CString(id)))
	defer C.free(unsafe.Pointer(idString))
	iconNameString := (*C.gchar)(unsafe.Pointer(C.CString(iconName)))
	defer C.free(unsafe.Pointer(iconNameString))

	indicator := unsafe.Pointer(C.app_indicator_new(idString, iconNameString, C.AppIndicatorCategory(category)))

	return &AppIndicator{
		IndicatorPtr: indicator,
	}
}