[Gambas-user] Balloons, everywhere but when I don't want them.

Fabien Bodard gambas.fr at ...626...
Mon Aug 21 21:56:32 CEST 2017


Tony I think it is needed as the notify functions depend on the
desktop used... and there is a big amount of possibilities in fact.

2017-08-18 21:14 GMT+02:00 Tony Morehen <tmorehen at ...3602...>:
> I'm not too sure that a component is needed since there is so little code
> involved.  I also not sure if a component would be appropriate.  I'll put
> together a Howto and a demo class and uploaded it in a day or two to the
> mailing list.
>
>
>
> On 2017-08-18 12:45 PM, Moviga Technologies wrote:
>>
>> 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.
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user



-- 
Fabien Bodard




More information about the User mailing list