Esempio n. 1
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,
	}
}
Esempio n. 2
0
// Creates a new AppIndicator using a specific icon path.
func NewAppIndicatorWithPath(id, iconName, iconPath string, category int) *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))
	iconPathString := (*C.gchar)(unsafe.Pointer(C.CString(iconPath)))
	defer C.free(unsafe.Pointer(iconPathString))

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

	return &AppIndicator{
		IndicatorPtr: indicator,
	}
}