Method: Tk::Text#count
- Defined in:
- lib/tk/text.rb
#count(idx1, idx2, *opts) ⇒ Object
634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 |
# File 'lib/tk/text.rb', line 634 def count(idx1, idx2, *opts) # opts are Tk8.5 feature cnt = 0 args = opts.collect{|opt| str = opt.to_s cnt += 1 if str != 'update' '-' + str } args << _get_eval_enc_str(idx1) << _get_eval_enc_str(idx2) if cnt <= 1 number(tk_send_without_enc('count', *args)) else list(tk_send_without_enc('count', *args)) end end |