[Kde-bindings] Qt::Object.connect for ruby-blocks

kelko kelko at anakrino.de
Mon Sep 4 12:14:37 UTC 2006


Richard Dale wrote:
> Yes, I was thinking of the other case when there are three args,
> plus a block and it should be invoked in the context of the last
> arg.
> 
> @button = KDE::PushButton.new(self)
> 
> class Foo < Qt::Object def initialize super @button =
> KDE::PushButton.new(self) end end
> 
> @other_button = Foo.new
> 
> Qt::Object.connect2Block(@button, SIGNAL('clicked()'),
> @other_button) { @button.text = "Hi" }
> 
> Here I would expect it to set the text of the button in Foo class
> as the target connected to the signal is an instance of Foo.

I'm still thinking about that. For, if it run in the context of the
target ( @other_button) the block could access methods and variables
otherwise not accessible (for private or protected). Shall this be
allowed?



More information about the Kde-bindings mailing list