[Gambas-user] DBusVariant or DBusValues?
Benoît Minisini
g4mba5 at gmail.com
Thu Feb 22 22:44:48 CET 2018
Le 22/02/2018 à 20:06, Hans Lehmann a écrit :
> Hello,
>
> why use the two classes _DBusMenuItem.class and _DBusMenuLayout.class of
> the component gb.dbus.trayicon
>
> 8<-----------------------------------------------
> ' Gambas class file
>
> Export
> Inherits DBusValues
>
> Public Const Signature As String = "u(ia{sv}av)"
>
> and
>
> ' Gambas class file
>
> Export
> Inherits DBusVariant
>
> Public Const Signature As String = "(ia{sv}av)"
>
> 8<-----------------------------------------------
>
> different classes?
> One DBusVariant and the other DBusValues.
> What are the reasons for the different choice of classes DBusVariant and
> DBusValues?
>
> With kind regards
>
> Honsek
>
Good. :-)
The reason is that if they were the same, i.e. if we had only
DBusVariant, it would not be possible to make the difference between a
DBus method that returns of array of three variants with a method that
returns three values, each one being a variant.
With DBusValues, we are sure that we want to return several values, and
that if it the value of the DBusValues is an array, then we have
multiple values.
The DBus signature associated with these things are different: "av" for
the DBusVariant, "vvv" for the DBusValues.
Regards,
--
Benoît Minisini
More information about the User
mailing list