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

In Files

  • tk/lib/tk/selection.rb

Class/Module Index [+]

Quicksearch

TkSelection

Constants

TkCommandNames

Public Class Methods

clear(sel=nil) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 12
def self.clear(sel=nil)
  if sel
    tk_call_without_enc('selection', 'clear', '-selection', sel)
  else
    tk_call_without_enc('selection', 'clear')
  end
end
            
clear_on_display(win, sel=nil) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 19
def self.clear_on_display(win, sel=nil)
  if sel
    tk_call_without_enc('selection', 'clear',
                        '-displayof', win, '-selection', sel)
  else
    tk_call_without_enc('selection', 'clear', '-displayof', win)
  end
end
            
get(keys=nil) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 32
def self.get(keys=nil)
  #tk_call('selection', 'get', *hash_kv(keys))
  _fromUTF8(tk_call_without_enc('selection', 'get', *hash_kv(keys)))
end
            
get_on_display(win, keys=nil) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 36
def self.get_on_display(win, keys=nil)
  #tk_call('selection', 'get', '-displayof', win, *hash_kv(keys))
  _fromUTF8(tk_call_without_enc('selection', 'get', '-displayof',
                                win, *hash_kv(keys)))
end
            
get_owner(sel=nil) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 59
def self.get_owner(sel=nil)
  if sel
    window(tk_call_without_enc('selection', 'own', '-selection', sel))
  else
    window(tk_call_without_enc('selection', 'own'))
  end
end
            
get_owner_on_display(win, sel=nil) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 66
def self.get_owner_on_display(win, sel=nil)
  if sel
    window(tk_call_without_enc('selection', 'own',
                               '-displayof', win, '-selection', sel))
  else
    window(tk_call_without_enc('selection', 'own', '-displayof', win))
  end
end
            
handle(win, func=Proc.new, keys=nil, &b) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 45
def self.handle(win, func=Proc.new, keys=nil, &b)
  if func.kind_of?(Hash) && keys == nil
    keys = func
    func = Proc.new(&b)
  end
  args = ['selection', 'handle']
  args.concat(hash_kv(keys))
  args.concat([win, func])
  tk_call_without_enc(*args)
end
            
set_owner(win, keys=nil) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 79
def self.set_owner(win, keys=nil)
  tk_call_without_enc('selection', 'own', *(hash_kv(keys) << win))
end
            

Public Instance Methods

clear(sel=nil) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 27
def clear(sel=nil)
  TkSelection.clear_on_display(self, sel)
  self
end
            
get(keys=nil) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 41
def get(keys=nil)
  TkSelection.get_on_display(self, sel)
end
            
get_owner(sel=nil) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 74
def get_owner(sel=nil)
  TkSelection.get_owner_on_display(self, sel)
  self
end
            
handle(func=Proc.new, keys=nil, &b) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 55
def handle(func=Proc.new, keys=nil, &b)
  TkSelection.handle(self, func, keys, &b)
end
            
set_owner(keys=nil) click to toggle source
 
               # File tk/lib/tk/selection.rb, line 82
def set_owner(keys=nil)
  TkSelection.set_owner(self, keys)
  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.