to val. Sorry, but I can’t give an accurate line number at the moment
as the code is full of debugging statements.
def dump(type_info, *index, &block)
when ‘tagoff’
result.push tk_tcl2ruby(val) #sel)
The line that needs to be changed is line 415 by my count.
In my sample:
p text.dump(‘tag’, ‘1.0’,‘1.14’)
prints:
[[“tagon”, “tag0000”, “1.0”], [“tagoff”, “tag0000”, “1.4”], [“tagon”,
“tag0001”, “1.6”], [“tagoff”, “tag0001”, “1.7”], [“tagon”, “tag0000”,
“1.10”]]
What version of Ruby and Tcl/Tk are you using?
I get the same thing once I make the change in line 415 and adjust my test
code. I’m on Ruby 1.6.7 and Tk8.3.3 (standard Debian 3 .debs).
Interestingly, using a code block still seems to give different results.
After fixing tktext.rb, I still get decimals instead of strings with:
text.dump(‘tag’, ‘1.0’, ‘1.14’){|x| p x}
Putting the code block in an each, however:
text.dump(‘tag’, ‘1.0’, ‘1.14’).each{|x| p x}
Yields identical return values as your ‘p text.dump…’ (As expected)
-
From my reading, this seems to have something to do with adding the block
parameter to the call to tk_send (following which lead me on something of
a goose chase)… which means the problem with the code block may be
outside of TkText#dump. Perhaps sending the code block outside dump can be
avoided using a kvis.collect at the end of the method before returning the
array.
-michael
···
On Wednesday 07 August 2002 23:51, Albert Wagner wrote:
++++++++++++++++++++++++++++++++++++++++++
Michael C. Libby x@ichimunki.com
public key: http://www.ichimunki.com/public_key.txt
web site: http://www.ichimunki.com
++++++++++++++++++++++++++++++++++++++++++