Class: BWidgetTreePatched

Inherits:
Tk::BWidget::Tree
  • Object
show all
Defined in:
lib/a-tkcommons.rb

Instance Method Summary collapse

Instance Method Details

#areabind(context, *args) ⇒ Object


15
16
17
18
19
20
21
22
23
24
# File 'lib/a-tkcommons.rb', line 15

def areabind(context, *args)
  if TkComm._callback_entry?(args[0]) || !block_given?
    cmd = args.shift
  else
    cmd = Proc.new
  end
  _bind_for_event_class(Event_for_Items, [path, 'bindArea'],
  context, cmd, *args)
  self
end

#areabind_append(context, *args) ⇒ Object


26
27
28
29
30
31
32
33
34
35
# File 'lib/a-tkcommons.rb', line 26

def areabind_append(context, *args)
  if TkComm._callback_entry?(args[0]) || !block_given?
    cmd = args.shift
  else
    cmd = Proc.new
  end
  _bind_append_for_event_class(Event_for_Items, [path, 'bindArea'],
  context, cmd, *args)
  self
end

#areabind_remove(*args) ⇒ Object


37
38
39
40
# File 'lib/a-tkcommons.rb', line 37

def areabind_remove(*args)
  _bind_remove_for_event_class(Event_for_Items, [path, 'bindArea'], *args)
  self
end

#areabindinfo(*args) ⇒ Object


42
43
44
# File 'lib/a-tkcommons.rb', line 42

def areabindinfo(*args)
  _bindinfo_for_event_class(Event_for_Items, [path, 'bindArea'], *args)
end

#open?(node) ⇒ Boolean

Returns:

  • (Boolean)

11
12
13
# File 'lib/a-tkcommons.rb', line 11

def open?(node)
  bool(self.itemcget(tagid(node), 'open'))
end

#selectedObject

def selectcommand(_proc=nil)

  self.configure('selectcommand'=>_proc)
end

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/a-tkcommons.rb', line 50

def selected
  if self.selection_get[0]
    if self.selection_get[0].respond_to?(:length) && self.selection_get[0].length >0
     	_selected = ""
      if self.selection_get[0].instance_of?(Array)
        selection_lines = self.selection_get[0]
      else
        if String.method_defined?(:lines)
      	   selection_lines = self.selection_get[0].lines
        else
      	   selection_lines = self.selection_get[0].split("\n")
        end
      end
      selection_lines.each{|_block|
        _selected = _selected + _block.to_s + "\s" 
      }
      _selected = _selected.strip
    else
      _selected = self.selection_get[0]
    end
  end
  return _selected
end