Skip to content

Callbacks on Windows #120

@Joustie

Description

@Joustie
  • Desktop Notifier version: 3.5.6
  • Python version: 3.8
  • Operating System: Windows 3.10

Description

I am trying the callback mechanism using the Et tu brutus example on Windows. There is no feedback after responding to the notification, I checked if the terminal was hanging by hitting enter a few times, but no, the callbacks don't seem to be executed.

Any special things I forgot for Windows? It works on my mac...

This script saved as send.py

import asyncio
from desktop_notifier import DesktopNotifier, Urgency, Button, ReplyField

notifier = DesktopNotifier()

async def main():
  await notifier.send(
      title="Julius Caesar",
      message="Et tu, Brute?",
      urgency=Urgency.Critical,
      buttons=[
        Button(
          title="Mark as read",
          on_pressed=lambda: print("Marked as read")),
      ],
      reply_field=ReplyField(
        title="Reply",
        button_title="Send",
        on_replied=lambda text: print("Brutus replied:", text),
      ),
      on_clicked=lambda: print("Notification clicked"),
      on_dismissed=lambda: print("Notification dismissed"),
      sound=True,
  )
  

loop = asyncio.get_event_loop()
loop.create_task(main())
loop.run_forever()

Executed
python send.py

Then entered answer in the textbox and clicked send

Screen Recording 2024-03-15 at 11 07 55

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions