[Fxruby-users] connect oddity?
Status: Inactive
Brought to you by:
lyle
|
From: Fredrik J. <fr...@po...> - 2004-06-14 13:23:24
|
Hi,
I tried using connect like this:
8<
j = 0
3.times { |i|
FXButton.new(self, "Button#{j}").connect(SEL_COMMAND) {
puts "#{j} pressed"
}
j += 1
}
>8
This doesn't work as intended, but if I use the 'i' variable, it does.
I figured it had to do with global/local scope, but I don't grok it
fully.
It's not really a problem, as a I have a workaround for it; but if
someone could please explain the behavour to me, I'd appreciate it.
Br,
//F
|