2
Ich versuche, ein Desktop-Benachrichtigungssystem mit Python und Libnotify zu entwickeln.Aktion Callback für libnotify funktioniert nicht
fand ich diese tutorial und versuchte, das Beispiel mit einer Aktion Rückruf, unter meiner Code-Änderung ist
#initialization of libnotify
Notify.init("Py-Notification")
#creating object
summary = "Wake Up!"
body = "Meeting at 9pm"
notification = Notify.Notification.new(
summary, body
)
# Define a callback function
def my_callback_func():
webbrowser.open('http://google.com')
#adding actions
notification.add_action(
"action_click",
"Reply to Alarm",
my_callback_func,
None # Arguments
)
notification.show()
Die Callback-Funktion nicht, wenn ich auf der „antworten Alarm“ Taste
genannt wird Irgendeine Hilfe.
das funktionierte, aber ich musste die Zeile # GLib.timeout_add_seconds (10, self.check) auskommentieren. Diese Linie schickte die Notifikation weiter. – jade