[Gambas-user] Interprocess communication....

Benoit Minisini gambas at ...1...
Mon May 7 17:28:53 CEST 2007


On lundi 7 mai 2007, sbungay wrote:
>    Thanks for the replies guys.
>    Since sending that email I have been playing around with command-line
> dcop and I can control the application from bash so using the shell
> command should work. Process_read can capture the output DCOP sends to
> stdout, this can then be parsed to locate the instance of konqueror I
> want to use. Konqueror also has a KIOSK mode (about to start playing
> with that now), so when I embed it into a frame on a form it should look
> nice and clean.
>    So I'll answer question #1.
>
> 1. (a)  Can GAMBAS use DCOP to talk to Kde Applications?
>     (b)  If so How?
>
>     (a) Yes, but not directly. You use the SHELL
>         to get at applications through DCOP (KDE only). Use process_read
>         to capture the output from DCOP.
>
>     (b) For example;
>
>         shell "dcop"
>
>     Would return a list of all running applications that use dcop for
> their interprocess communication. Lets say it returns the following;
>
>     konqueror-4400
>     kmix
>     kookiejar
>
>    So there is one running instance of Konqueror, for this example lets
> assume that this is the one we want to use.. Issue another shell command;
>
>       shell "dcop konqueror-4400 konqueror-mainwindow#1 openURL
> http://www.google.com"
>
>    And Konqueror will go to google. This is EXACTLY what is desired. :)
>
>    Likewise if we send it a fully qualified filename it will process and
> display the file (PNG, text, SWF, etc). OF course it has to have the
> plug-ins to handle movies, sound, and the like. Sooooo...
>
>       dcop konqueror-4400 konqueror-mainwindow#1 openURL
> /home/username/Graphics/How\ software\ patents\ work.wmv
>
>    will play the movie in Konqueror.. so long as it has a plug-in to
> handle the wmv.
>
>    For any of you out there who used to use the Commodore Amiga and
> AREXX, this is similar to using the REXX port of an app to send it
> commands.
>

Or you can use the gb.qt.kde component. 

You have two automation examples provided with Gambas: one that changes the 
KDE desktop background periodically, and another that displays a little 
window with a button and a popup menu that allows you to browse the functions 
in a C source code file edited with Kate.

Look at the source code!

Regards,

-- 
Benoit Minisini




More information about the User mailing list