【发布时间】:2020-11-19 03:36:47
【问题描述】:
我正在学习 vala 语言,我想创建一个服务来触发通知。 这是我的代码
public class Services.Notifications : Glib.Object {
public void sendNotification (string title, string body,string icon_name, GLib.NotificationPriority priority) {
var notification = new Notification (title);
notification.set_body (body);
notification.set_icon (new ThemedIcon (icon_name));
notification.set_priority (priority);
send_notification ("com.github.andirsun.myapp", notification);
}
}
但我面临这个错误
class Notifications: null
base type `null' of class `Services.Notifications' is not an object type
我在 meson.build 文件中添加了文件 Services/Notification.vala 无效
【问题讨论】: