In Files

  • tk/lib/tk/text.rb

Class/Module Index [+]

Quicksearch

Tk::Text::IndexModMethods

Public Instance Methods

+(mod) click to toggle source
 
               # File tk/lib/tk/text.rb, line 84
def +(mod)
  return chars(mod) if mod.kind_of?(Numeric)

  mod = mod.to_s
  if mod =~ /^\s*[+-]?\d/
    Tk::Text::IndexString.new(String.new(id) << ' + ' << mod)
  else
    Tk::Text::IndexString.new(String.new(id) << ' ' << mod)
  end
end
            
-(mod) click to toggle source
 
               # File tk/lib/tk/text.rb, line 95
def -(mod)
  return chars(-mod) if mod.kind_of?(Numeric)

  mod = mod.to_s
  if mod =~ /^\s*[+-]?\d/
    Tk::Text::IndexString.new(String.new(id) << ' - ' << mod)
  elsif mod =~ /^\s*[-]\s+(\d.*)$/
    Tk::Text::IndexString.new(String.new(id) << ' - -' << $1)
  else
    Tk::Text::IndexString.new(String.new(id) << ' ' << mod)
  end
end
            
any_char(mod) click to toggle source
Alias for: any_chars
any_chars(mod) click to toggle source
 
               # File tk/lib/tk/text.rb, line 129
def any_chars(mod)
  # Tk8.5 feature
  fail ArgumentError, 'expect Integer'  unless mod.kind_of?(Integer)
  if mod < 0
    Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any chars')
  else
    Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any chars')
  end
end
            
Also aliased as: any_char
any_indices(mod) click to toggle source
 
               # File tk/lib/tk/text.rb, line 160
def any_indices(mod)
  # Tk8.5 feature
  fail ArgumentError, 'expect Integer'  unless mod.kind_of?(Integer)
  if mod < 0
    Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any indices')
  else
    Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any indices')
  end
end
            
any_line(mod) click to toggle source
Alias for: any_lines
any_lines(mod) click to toggle source
 
               # File tk/lib/tk/text.rb, line 191
def any_lines(mod)
  # Tk8.5 feature
  fail ArgumentError, 'expect Integer'  unless mod.kind_of?(Integer)
  if mod < 0
    Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any_lines')
  else
    Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any lines')
  end
end
            
Also aliased as: any_line
char(mod) click to toggle source
Alias for: chars
chars(mod) click to toggle source
 
               # File tk/lib/tk/text.rb, line 108
def chars(mod)
  fail ArgumentError, 'expect Integer'  unless mod.kind_of?(Integer)
  if mod < 0
    Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' chars')
  else
    Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' chars')
  end
end
            
Also aliased as: char
display_char(mod) click to toggle source
Alias for: display_chars
display_chars(mod) click to toggle source
 
               # File tk/lib/tk/text.rb, line 118
def display_chars(mod)
  # Tk8.5 feature
  fail ArgumentError, 'expect Integer'  unless mod.kind_of?(Integer)
  if mod < 0
    Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display chars')
  else
    Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display chars')
  end
end
            
Also aliased as: display_char
display_indices(mod) click to toggle source
 
               # File tk/lib/tk/text.rb, line 150
def display_indices(mod)
  # Tk8.5 feature
  fail ArgumentError, 'expect Integer'  unless mod.kind_of?(Integer)
  if mod < 0
    Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display indices')
  else
    Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display indices')
  end
end
            
display_line(mod) click to toggle source
Alias for: display_lines
display_lineend() click to toggle source
 
               # File tk/lib/tk/text.rb, line 213
def display_lineend
  # Tk8.5 feature
  Tk::Text::IndexString.new(String.new(id) << ' display lineend')
end
            
display_lines(mod) click to toggle source
 
               # File tk/lib/tk/text.rb, line 180
def display_lines(mod)
  # Tk8.5 feature
  fail ArgumentError, 'expect Integer'  unless mod.kind_of?(Integer)
  if mod < 0
    Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display_lines')
  else
    Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display lines')
  end
end
            
Also aliased as: display_line
display_linestart() click to toggle source
 
               # File tk/lib/tk/text.rb, line 209
def display_linestart
  # Tk8.5 feature
  Tk::Text::IndexString.new(String.new(id) << ' display linestart')
end
            
display_wordend() click to toggle source
 
               # File tk/lib/tk/text.rb, line 229
def display_wordend
  # Tk8.5 feature
  Tk::Text::IndexString.new(String.new(id) << ' display wordend')
end
            
display_wordstart() click to toggle source
 
               # File tk/lib/tk/text.rb, line 225
def display_wordstart
  # Tk8.5 feature
  Tk::Text::IndexString.new(String.new(id) << ' display wordstart')
end
            
indices(mod) click to toggle source
 
               # File tk/lib/tk/text.rb, line 140
def indices(mod)
  # Tk8.5 feature
  fail ArgumentError, 'expect Integer'  unless mod.kind_of?(Integer)
  if mod < 0
    Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' indices')
  else
    Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' indices')
  end
end
            
line(mod) click to toggle source
Alias for: lines
lineend() click to toggle source
 
               # File tk/lib/tk/text.rb, line 205
def lineend
  Tk::Text::IndexString.new(String.new(id) << ' lineend')
end
            
lines(mod) click to toggle source
 
               # File tk/lib/tk/text.rb, line 170
def lines(mod)
  fail ArgumentError, 'expect Integer'  unless mod.kind_of?(Integer)
  if mod < 0
    Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' lines')
  else
    Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' lines')
  end
end
            
Also aliased as: line
linestart() click to toggle source
 
               # File tk/lib/tk/text.rb, line 202
def linestart
  Tk::Text::IndexString.new(String.new(id) << ' linestart')
end
            
wordend() click to toggle source
 
               # File tk/lib/tk/text.rb, line 221
def wordend
  Tk::Text::IndexString.new(String.new(id) << ' wordend')
end
            
wordstart() click to toggle source
 
               # File tk/lib/tk/text.rb, line 218
def wordstart
  Tk::Text::IndexString.new(String.new(id) << ' wordstart')
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.