[Gambas-user] DBus - How are signal data converted to Gambas data?

Benoît Minisini g4mba5 at gmail.com
Tue Jan 30 03:10:30 CET 2018


Le 30/01/2018 à 00:54, T Lee Davidson a écrit :
> On 01/29/2018 04:23 AM, Karl Reinl wrote:
>> Am Montag, den 29.01.2018, 03:45 -0500 schrieb T Lee Davidson:
>>> Thanks, Fabien. I was really eager to dive in to that example, except ... I can't find it.
>>>
>>> I looked at All software on the Farm, not just Examples. I even looked on the Wiki thinking it might be there. It might be, but
>>> I don't see it.
>>>
>>> Will you give me a clue?
>>>
>>>
>>
>> Salut Lee,
>>
>> that's from gambas3 source code, you find it at <your dir>/comp/src.
>> Most of gb.*.* is from there.
>>   
> 
> Thanks Charlie.
> 
> I don't keep a local copy of the source, but I found it on GitLab.
> 
> Unfortunately, I still can't seem to wrap my head around the DBusValues and DBusVariant concepts.
> 
> They both appear to be stupid data containers that can be inherited and customized to make them smart. But, I see no difference
> between them and, hence, am unable to determine when one should be preferred over the other.
> 
> This confusion is enhanced by gb.dbus.trayicon seeming to use them interchangeably and DBusValues.class being defined as
> 
> [code]
> ' Gambas class file
> 
> Export
> Inherits DBusVariant
> [/code]
> 
> which adds nothing to DBusVariant.
> 
> 
> At this point if working on my own project, I would revert to a strictly procedural implementation instead of engaging in
> further head-banging.
> 
> 

As explained in the wiki, DBusValue must be used when you have to 
implement a DBus method that returns several values. Which is possible 
in DBus, but not in Gambas.

DBusVariant is the datatype used to implement your own datatype 
conversion between a DBus value and a Gambas value.

You should not have any use of that just for catching signals, shouldn't 
you?

-- 
Benoît Minisini


More information about the User mailing list