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
Open
Description
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
Labels
No labels