Method: Tk::Text#insert
- Defined in:
- lib/tk/text.rb
#insert(index, chars, *tags) ⇒ Object
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 |
# File 'lib/tk/text.rb', line 594 def insert(index, chars, *) if [0].kind_of?(Array) # multiple chars-taglist argument :: str, [tag,...], str, [tag,...], ... args = [chars] while .size > 0 args << .shift.collect{|x|_get_eval_string(x)}.join(' ') # taglist args << .shift if .size > 0 # chars end super(index, *args) else # single chars-taglist argument :: str, tag, tag, ... if .size == 0 super(index, chars) else super(index, chars, .collect{|x|_get_eval_string(x)}.join(' ')) end end end |