dimanche 10 juillet 2016

action callback for libnotify not working


I am trying to develop a desktop notification system with python and Libnotify.

I found this tutorial and tried the example with an action callback, below is my code modification

#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()

The callback function is not called whenever I click on the "Reply to Alarm" button

Any help.


Aucun commentaire:

Enregistrer un commentaire