Todd
In summary, (page 358) it says this:
"A return from inside a block that's still in scope acts as a return
from that scope. A return from a block whose original context is not
longer valid raises an exception (LocalJumpError or ThreadError
depending on the context)..."
It then goes on to cite examples and offers ideas for workarounds.
Google search showed a few hits. Here's one with a workaround:
http://blog.jayfields.com/2007/03/ruby-localjumperror-workaround.html
Todd
I found if I moved the code out of add_action_callback and into its
own method, and then called the method from add_action_callback, the
error goes away. I'd still like to better understand why, though.
Here's an example:
# OLD CODE
dialog.add_action_callback("name") {
# lots of code
}
# NEW CODE
def name(*args)
# lots of code
end
dialog.add_action_callback("name") { name() }
I'm no ruby internals expert, but it might have something to do with
the static nature of a hard coded method (your new code) versus the
dynamic nature of the code block {...} in your first method. Perhaps
the block method is structured internally in an automatic storage
manner, and jumping back from automatic storage is what now causes
this exception. (Grasping here?)
Glad you got it working. Hope my input helped.
Todd