[Kde-bindings] Implementing Ruby DCOP

Richard Dale Richard_Dale at tipitina.demon.co.uk
Fri Sep 26 13:47:55 UTC 2003


On Friday 26 September 2003 12:53, Richard Dale wrote:
> On Friday 26 September 2003 12:29, Alexander Kellett wrote:
> > On Fri, Sep 26, 2003 at 11:20:11AM +0100, Richard Dale wrote:
> > > No, you don't need that because the clientDied() method actually exists
> > > in dcopClient() - it gets added dynamically. It's just a matter of
> > > adding an option to emit() so that it runs a block if one is passed to
> > > it. If the arg is an ordinary method call is that just gets called when
> > > passed. But if the syntax is ugly/not rubylike, perhaps it isn't worth
> > > doing.
> >
> > "exists in dcopClient"
> >
> > problem is you're in local scope, not dcopClient scope
> > so it doesn't really matter what dcopClient has declared
> > surely?, maybe i'm a tad mixed up though.
>
> Then:
>
> 				$kapp.dcopClient().instance_eval(&block)
>
> ..Would do it.
>
> The clientDied() method would actually map onto a C function
> kdcop_signal(), as would all signals. So that would do the actual dcop
> sending stuff.
I think the clientDied() method should get dynamically added to the class 
which declared the k_dcop signal, rather than dcopClient(). Then it could be 
called in the local scope ok, either as a method call or by running a block. 
And that would still map onto the C function kdcop_signal().

-- Richard


More information about the Kde-bindings mailing list