[Gambas-user] Monitoring DBus-Signal ?
Hans Lehmann
hans at ...3219...
Sat Nov 19 17:14:38 CET 2016
Hello,
I want to see the signal 'VolumeChanged' sent by the application
'org.gtk.Private.MTPVolumeMonitor' with the interface
'org.gtk.Private.RemoteVolumeMonitor'. The dbus-monitor program shows:
signal sender=:1.10 -> dest=(null destination) serial=319
path=/org/gtk/Private/RemoteVolumeMonitor;
interface=org.gtk.Private.RemoteVolumeMonitor; member=VolumeChanged
I am not able to observe this DBus signal. The project is attached. The
project follows the documentation under the link:
http://gambaswiki.org/wiki/doc/dbus#t4 .
Sincerely,
Hans
Code:
' Gambas class file
Public hDBusObject As New DBusObject
Public hDBusSignal As DBusSignal
Public Sub Form_Open()
FMain.Resizable = False
DBus.Debug = True
DBus.Unique = True
DBus.Session.Register(hDBusObject, Application.Path) ' o.k.
hDBusSignal = New DBusSignal(DBus.Session,
"org.gtk.Private.RemoteVolumeMonitor") As "MySignal"
End
Public Sub MySignal_Signal(Signal As String, Arguments As Variant[])
Print Signal
Print Arguments.Count
' If Signal = "VolumeChanged" Then Print ("USB-Stick or SD-Card
registered!")
' If Signal = "VolumeRemoved" Then Print ("USB-Stick or SD-Card
deregistered!")
End
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SignalWatch-1.2.10.tar.gz
Type: application/gzip
Size: 52070 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20161119/cdcb6b58/attachment.gz>
More information about the User
mailing list