[squeak-dev] DBus bindings
hmm2 at heeg.de
Wed Feb 23 21:58:35 UTC 2011
I'm using the DBus bindings in a recording and CD burning app, and it works very well (this is a 3.9 image, though.) Thanks Bert for this nice and useful piece of work!
Bert Freudenberg <bert at freudenbergs.de> schrieb:
>On 23.02.2011, at 11:04, Gary Dunn wrote:
>> Someone told me Gnome's
>> library just traps DBus signals, so I looked into DBus and read that I
>> should use one of the higher level bindings. And what did I find on the
>> bindings page (www.freedesktop.org)? Bindings for Squeak by Bert
>> Can someone give me a 1-2-3 on how to incorporate the six mcz files on
>> SqueakSource into a 4.2 image? I am a Monticello newbie. Anyone using
>> them care to share their insights and experiences?
>I have not tried this in a 4.x image, but in general you need to load DBus-Core first, then DBus-Objects. Those are the two you would need "in production". And of course the DBusPlugin in your VM directory.
>The only application I know using it is Etoys. If you run Etoys under Linux, just press ctrl-comma then open a DBus Explorer to peek around. To install that in your own image, load the DBus-Tools package.
>To call methods via DBus you get a proxy for it and send a message:
>proxy := DBus sessionBus getObject: 'org.gnome.ScreenSaver' path: '/'.
>proxy SetActive: true
>Similarly to register for signals:
>proxy onDBusSignal: 'interface.member' send: #someSelector to: someObject
>To create a DBus service (make an object available via DBus), you subclass DBusObject and "export" it:
>DBus sessionBus export: myObject on: 'org.mydomain.myapp' at: '/path/to/my/object'
>That's basically it. You can find usage examples in the Etoys image.
>- Bert -
More information about the Squeak-dev