Re: Sending notification



Il giorno mar, 24/05/2011 alle 13.41 -0400, Erick Pérez ha scritto:
> > What do you mean?
> >
> > From an extension:
> > For short lived message, use
> > let source = new MessageTray.SystemNotificationSource();
> > let notification = new MessageTray.Notification(source, "Title",
> > "Content", { body: "Additional content that won't be shown in the
> > banner" });
> > source.notify(notification);
> > For anything else, and in particular for things that should be
> > associated with objects (apps, people, folders, tasks...), write your
> > own Source class.
> > You find extensive docs in js/ui/messageTray.js, and examples in
> > NotificationDaemon, TelepathyClient and some extensions. It is extremely
> > flexible (in the end you can just replace the whole contents of the
> > notification and have your own widgets) and should be enough for
> > anybody.
> 
> This was what I meant, the application part I knew it
> I tried this way but I wan't able to let the notification source
> resident, until the user click on it.
> I was even using the resident hint, anyway I'll try it again, I'll let
> u know if anything else

You need to call notification.setResident(true) before calling
source.notify(), and you need to have your own custom Source
(SystemNotificationSource calls .setTransient(true))
Note that resident will not force the notification into staying in
banner mode (that is, in the middle of the screen), it will just make
clicks on actions and on the background have no effect.
If you want to destroy on click, but not on action button press, connect
to "clicked" and call .destroy(). If you want to destroy on any action,
use the default behavior (.setTransient(false) and .setResident(false)).

Giovanni

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]