Ruby and KDE (Re: [Kde-bindings] qtruby compile error)

Richard Dale Richard_Dale at tipitina.demon.co.uk
Tue Sep 28 03:49:36 UTC 2004


On Tuesday 28 September 2004 04:03, Navindra Umanee wrote:
> Richard Dale <Richard_Dale at tipitina.demon.co.uk> wrote:
> > > http://www.osnews.com/story.php?news_id=8408
> >
> > Great! It's a shame they've spelt wrongly - should be 'Rubydium'. It goes
> > really well with Korundum though - an elements/minerals theme.
>
> Looks like they fixed it.
>
> http://developers.slashdot.org/article.pl?sid=04/09/28/020257
Ah fame! It was always my ambition to get my stuff on slashdot when I first 
started Free Software hacking..

> Not on the main page I guess.
>
> > Have you tried passing a block to a constructor in Korundum - that's
> > quite fun?
>
> I'm still at QtRuby!  Don't tempt me.  :) Okay, what does that do?
Well not all that much - you can do it in QtRuby too. It's just something you 
can't do in C++, and it's a typical ruby idiom I suppose:

calltest = SenderWidget.new(nil, "calltest") { setText 'DCOP Call Test' }

You can pass a chunk of code to the constructor, so you sort of got you're own 
customized constructor that does more than the usual one. Or do it this way 
to pick up the surrounding environment of the thing being constructed:

a = 'DCOP Call Test' 
calltest = SenderWidget.new(nil, "calltest") { |w| w.setText a }

-- Richard



More information about the Kde-bindings mailing list