module TkSelection
Constants
- TkCommandNames
Public Class Methods
Source
# File lib/tk/selection.rb, line 13 def self.clear(sel=nil) if sel tk_call_without_enc('selection', 'clear', '-selection', sel) else tk_call_without_enc('selection', 'clear') end end
Source
# File lib/tk/selection.rb, line 20 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
Source
# File lib/tk/selection.rb, line 33 def self.get(keys=nil) #tk_call('selection', 'get', *hash_kv(keys)) _fromUTF8(tk_call_without_enc('selection', 'get', *hash_kv(keys))) end
Source
# File lib/tk/selection.rb, line 37 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
Source
# File lib/tk/selection.rb, line 61 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
Source
# File lib/tk/selection.rb, line 68 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
Source
# File lib/tk/selection.rb, line 46 def self.handle(win, func=nil, keys=nil, &b) func ||= b if func.kind_of?(Hash) && keys == nil keys = func func = b end args = ['selection', 'handle'] args.concat(hash_kv(keys)) args.concat([win, func]) tk_call_without_enc(*args) end
Source
# File lib/tk/selection.rb, line 81 def self.set_owner(win, keys=nil) tk_call_without_enc('selection', 'own', *(hash_kv(keys) << win)) end
Public Instance Methods
Source
# File lib/tk/selection.rb, line 28 def clear(sel=nil) TkSelection.clear_on_display(self, sel) self end
Source
# File lib/tk/selection.rb, line 42 def get(keys=nil) TkSelection.get_on_display(self, sel) end
Source
# File lib/tk/selection.rb, line 76 def get_owner(sel=nil) TkSelection.get_owner_on_display(self, sel) self end
Source
# File lib/tk/selection.rb, line 57 def handle(func=nil, keys=nil, &b) TkSelection.handle(self, func || b, keys, &b) end
Source
# File lib/tk/selection.rb, line 84 def set_owner(keys=nil) TkSelection.set_owner(self, keys) self end