Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more

In Files

  • tk/lib/tk/textmark.rb

Parent

Methods

Class/Module Index [+]

Quicksearch

TktNamedMark

Public Class Methods

new(parent, name, index=nil) click to toggle source
 
               # File tk/lib/tk/textmark.rb, line 143
def self.new(parent, name, index=nil)
  TMarkID_TBL.mutex.synchronize{
    if TMarkID_TBL[parent.path] && TMarkID_TBL[parent.path][name]
      obj = TMarkID_TBL[parent.path][name]
    else
      # super(parent, name, *args)
      (obj = self.allocate).instance_eval{
        @parent = @t = parent
        @tpath = parent.path
        @path = @id = name
        TMarkID_TBL[@id] = self
        TMarkID_TBL[@tpath] = {} unless TMarkID_TBL[@tpath]
        TMarkID_TBL[@tpath][@id] = self unless TMarkID_TBL[@tpath][@id]
        @t._addtag @id, self
      }
      obj
    end

    if obj && index
      tk_call_without_enc(parent.path, 'mark', 'set', name,
                          _get_eval_enc_str(index))
    end
    obj
  }
end
            
new(parent, name, index=nil) click to toggle source
 
               # File tk/lib/tk/textmark.rb, line 169
def initialize(parent, name, index=nil)
  # dummy:: not called by 'new' method

  #unless parent.kind_of?(Tk::Text)
  #  fail ArgumentError, "expect Tk::Text for 1st argument"
  #end
  @parent = @t = parent
  @tpath = parent.path
  @path = @id = name
  tk_call_without_enc(@t.path, 'mark', 'set', @id,
                      _get_eval_enc_str(index)) if index
  @t._addtag @id, self
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.