Method: Tk::Text#count_info

Defined in:
lib/tk/text.rb

#count_info(idx1, idx2, update = true) ⇒ Object



650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
# File 'lib/tk/text.rb', line 650

def count_info(idx1, idx2, update=true)
  # Tk8.5 feature
  opts = [
    :chars, :displaychars, :displayindices, :displaylines,
    :indices, :lines, :xpixels, :ypixels
  ]
  if update
    lst = count(idx1, idx2, :update, *opts)
  else
    lst = count(idx1, idx2, *opts)
  end
  info = {}
  opts.each_with_index{|key, idx| info[key] = lst[idx]}
  info
end