[Gambas-user] another highlighter problem in the IDE

Bruce Steers bsteers4 at gmail.com
Mon Nov 6 11:56:04 CET 2023


On Mon, 6 Nov 2023 at 05:52, BB <adamnt42 at gmail.com> wrote:

>
> On 6/11/23 4:17 pm, BB wrote:
>
> On 6/11/23 2:36 pm, Bruce Steers wrote:
>
>
>
> On Sat, 4 Nov 2023 at 02:32, BB <adamnt42 at gmail.com> wrote:
>
>> Thanks Benoît
>>
>> Much better, now the real problem. I am having trouble defining a dbus
>> event handler and cant see what I have miscoded when I create it. But it
>> doesn't seem that events are "pasteable" from the DBUS Explorer?
>>
>
> There might be a bug in dbus for events.
>
> I made a couple of sample programs for you.
>  one a dbus sender then emits a signal every second, and another to pick
> up on the signal.
> (see attachment)
>
> It's got a problem though.
>
> I set it up to have all the same address name
> DBus.Name org.gambas.dbsend
> Object Path /org/gambas/dbsend
> Interface org.gambas.dbsend
> Event org_gambas_dbsend_MyEvent()
>
> I was having trouble getting the signal so i used dbus-monitor to find the
> signal details.
>
> seems the interface i needed to use was this...
>   dbs = New DBusSignal(DBus.Session, "org.gamba.dbsend", True) As "DBS"
>
> Notice the word gamba  , the s is missing!
>
> using org.gambas.dbsend did not work
>
> Respects
> BruceS
>
> mmmm. Your progs run fine here when I changed it back to
> "org.gambas.dbsend", but there is something strange (I think) about the
> event parameters. qdbusviewer introspection shows the following:
>
> <signal name="MyEvent"> <arg name="arg1" type="s" direction="in"/>
> </signal>
>
> I am just wondering why the param direction is "in"? Or perhaps ...
>
> b
>
> Nah forget I said that, its not the problem.
>

Well that's just freaky.
Today it does not work with gamba but only as gambas :-\  wtf !

Does it help you with your own problem defining your handler m8?

what's important is the prefix for the handler, in my case,
org_gambas_dbsend_MyEvent() matches the interface name org.gambas.dbsend
but with underscores not dots.
Also using DBus.Raise() to trigger it.

And on the other side you have to use the _Signal(Name As String, Arg as
Variant[]) event of the DBusSignal watcher.

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20231106/7a414b36/attachment-0001.htm>


More information about the User mailing list