[Gambas-user] Balloons, everywhere but when I don't want them.
Moviga Technologies
moviga at ...3488...
Fri Aug 18 18:45:42 CEST 2017
This could perhaps implemented into the gb.Desktop component as
'Desktop.Notify()'?
Den 18.08.2017 16:15, skrev Tobias Boege:
> On Fri, 18 Aug 2017, Tony Morehen wrote:
>
>> Gambas can talk to the notifications daemon via Dbus. I use this code:
>>
>> Private NotifyInterface As String = "org.freedesktop.Notifications"
>> Private NotifyApp As String = "session://" & NotifyInterface
>> Private NotifyPath As String = "/" & Replace(NotifyInterface, ".", "/")
>>
>> 'does the daemon support icon, body, button to click etc
>> Dim sArray As String[] = Dbus[NotifyApp][NotifyPath,
>> NotifyInterface].GetCapabilities()
>> 'popup (the hintsCollection is an empty collection, iDuration = -1, use
>> default)
>> notifyID = Dbus[NotifyApp][NotifyPath,
>> NotifyInterface].Notify(AppName, notifyID, IconPath,SummaryText, BodyText,
>> [TextToSignal, ButtonText], hintsCollection, iDuration)
>> 'setup dbussignal to get popup closed and and buttonpressed notifications
>>
>> Private NotifySignal as New DbusSignal(Dbus.Session,NotifyInterface, True)
>> As "NotifyDbusSignal"
>> 'signal handler
>> Public Sub NotifyDbusSignal_Signal(Signal As String, Arguments As Variant[])
>> Select Case Signal
>> Case "NotificationClosed"
>> Case "ActionInvoked"
>> 'Arguments[0] contains TextToSignal from above
>> End Select
>> End
>
> I just checked the code and this is exactly what libnotify does.
More information about the User
mailing list