Hello, this is my code:
#include <glib.h>
#include <unistd.h>
#include <libnotify/notify.h>
void push_notification (gchar* title,
gchar* body,
gchar* icon)
{
NotifyNotification* notification;
gboolean success;
GError* error = NULL;
/* initial notification */
notification = notify_notification_new (title, body, icon, NULL);
notify_notification_set_hint_string (notification,
"x-canonical-append",
"");
error = NULL;
success = notify_notification_show (notification, &error);
if (!success)
{
g_print ("That did not work ... \"%s\".\n",
error->message);
g_error_free (error);
}
g_signal_connect(G_OBJECT (notification),
"closed",
G_CALLBACK (NULL),
NULL);
g_object_unref (G_OBJECT (notification));
notify_uninit ();
sleep (3); /* simulate a user typing */
}
int main ()
{
if (!notify_init ("append-hint-example"))
return 1;
push_notification ("Program",
"Hello",
"notification-message-im");
push_notification ("Program",
"how are you?",
"notification-gsm-medium");
push_notification ("Program",
"Good to hear that",
"notification-message-im");
return 0;
}
It's the sample code provided by notify-osd's source for the append ability of notifications. In the g_signal_connect() function I have no idea what should I put as 3rd argument (inside the G_CALLBACK()i put NULL and it works just fine, but it outputs error message
p, li { white-space: pre-wrap; } GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `c_handler != NULL' failed
Im running Ubuntu 11.04 thanks in advance for any answers!