destroy()
click to toggle source
exist?()
click to toggle source
def exist?
if ( tk_split_simplelist(tk_call_without_enc(@t.path, 'mark', 'names'), false, true).find{|id| id == @id } )
true
else
false
end
end
gravity()
click to toggle source
def gravity
tk_call_without_enc(@t.path, 'mark', 'gravity', @id)
end
gravity=(direction)
click to toggle source
def gravity=(direction)
tk_call_without_enc(@t.path, 'mark', 'gravity', @id, direction)
direction
end
id()
click to toggle source
def id
Tk::Text::IndexString.new(@id)
end
mutex()
click to toggle source
next(index = nil)
click to toggle source
def next(index = nil)
if index
@t.tagid2obj(_fromUTF8(tk_call_without_enc(@t.path, 'mark', 'next', _get_eval_enc_str(index))))
else
@t.tagid2obj(_fromUTF8(tk_call_without_enc(@t.path, 'mark', 'next', @id)))
end
end
pos()
click to toggle source
begin¶ ↑
def +(mod)
return chars(mod) if mod.kind_of?(Numeric)
mod = mod.to_s
if mod =~ /^\s*[+-]?\d/
Tk::Text::IndexString.new(@id + ' + ' + mod)
else
Tk::Text::IndexString.new(@id + ' ' + mod)
end
end
def -(mod)
return chars(-mod) if mod.kind_of?(Numeric)
mod = mod.to_s
if mod =~ /^\s*[+-]?\d/
Tk::Text::IndexString.new(@id + ' - ' + mod)
elsif mod =~ /^\s*[-]\s+(\d.*)$/
Tk::Text::IndexString.new(@id + ' - -' + $1)
else
Tk::Text::IndexString.new(@id + ' ' + mod)
end
end
def pos
@t.index(@id)
end
pos=(where)
click to toggle source
def pos=(where)
set(where)
end
previous(index = nil)
click to toggle source
def previous(index = nil)
if index
@t.tagid2obj(_fromUTF8(tk_call_without_enc(@t.path, 'mark', 'previous', _get_eval_enc_str(index))))
else
@t.tagid2obj(_fromUTF8(tk_call_without_enc(@t.path, 'mark', 'previous', @id)))
end
end
set(where)
click to toggle source
def set(where)
tk_call_without_enc(@t.path, 'mark', 'set', @id,
_get_eval_enc_str(where))
self
end
unset()
click to toggle source
def unset
tk_call_without_enc(@t.path, 'mark', 'unset', @id)
self
end