Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

How to catch signals? #56

@dicktracy87

Description

@dicktracy87

I'm playing with the Notifications example, I would like to print something on the console output when a notification is closed. So I added the event to the interface

    [Interface ("org.freedesktop.Notifications")]
    public interface Notifications : Introspectable, Properties
    {
        ServerInformation GetServerInformation ();
        string[] GetCapabilities ();
        void CloseNotification (uint id);
        uint Notify (string app_name, uint id, string icon, string summary, string body, string[] actions, IDictionary<string,object> hints, int timeout);
        event NotificationClosedHandler NotificationClosed;
        event ActionInvokedHandler ActionInvoked;
    }
    public delegate void NotificationClosedHandler (uint id, uint reason);
    public delegate void ActionInvokedHandler (uint id, string action);

And the delegate in the main:

    nf.NotificationClosed += delegate(uint id, uint reason) {
        Console.WriteLine("Notification Closed");
    };

The code compiles without errors but I nothing is printed when a notifications is closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions