| Module | TkcTagAccess |
| In: |
tk/canvastag.rb
|
Included Modules
Public Instance methods
Following operators support logical expressions of canvas tags (for Tk8.3+). If tag1.path is ‘t1’ and tag2.path is ‘t2’, then
ltag = tag1 & tag2; ltag.path => "(t1)&&(t2)"
ltag = tag1 | tag2; ltag.path => "(t1)||(t2)"
ltag = tag1 ^ tag2; ltag.path => "(t1)^(t2)"
ltag = - tag1; ltag.path => "!(t1)"
# File tk/canvastag.rb, line 169
169: def & (tag)
170: if tag.kind_of? TkObject
171: TkcTagString.new(@c, '(' + @id + ')&&(' + tag.path + ')')
172: else
173: TkcTagString.new(@c, '(' + @id + ')&&(' + tag.to_s + ')')
174: end
175: end
# File tk/canvastag.rb, line 185
185: def ^ (tag)
186: if tag.kind_of? TkObject
187: TkcTagString.new(@c, '(' + @id + ')^(' + tag.path + ')')
188: else
189: TkcTagString.new(@c, '(' + @id + ')^(' + tag.to_s + ')')
190: end
191: end
# File tk/canvastag.rb, line 15
15: def addtag(tag)
16: @c.addtag(tag, 'withtag', @id)
17: self
18: end
def bind(seq, cmd=Proc.new, *args)
@c.itembind(@id, seq, cmd, *args) self
end
# File tk/canvastag.rb, line 28
28: def bind(seq, *args)
29: # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
30: if TkComm._callback_entry?(args[0]) || !block_given?
31: cmd = args.shift
32: else
33: cmd = Proc.new
34: end
35: @c.itembind(@id, seq, cmd, *args)
36: self
37: end
def bind_append(seq, cmd=Proc.new, *args)
@c.itembind_append(@id, seq, cmd, *args) self
end
# File tk/canvastag.rb, line 43
43: def bind_append(seq, *args)
44: # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
45: if TkComm._callback_entry?(args[0]) || !block_given?
46: cmd = args.shift
47: else
48: cmd = Proc.new
49: end
50: @c.itembind_append(@id, seq, cmd, *args)
51: self
52: end
# File tk/canvastag.rb, line 54
54: def bind_remove(seq)
55: @c.itembind_remove(@id, seq)
56: self
57: end
def configure(keys)
@c.itemconfigure @id, keys
end
# File tk/canvastag.rb, line 75
75: def configinfo(key=nil)
76: @c.itemconfiginfo(@id, key)
77: end
# File tk/canvastag.rb, line 67
67: def configure(key, value=None)
68: @c.itemconfigure(@id, key, value)
69: self
70: end
# File tk/canvastag.rb, line 79
79: def current_configinfo(key=nil)
80: @c.current_itemconfiginfo(@id, key)
81: end
# File tk/canvastag.rb, line 87
87: def dchars(first, last=None)
88: @c.dchars(@id, first, last)
89: self
90: end
# File tk/canvastag.rb, line 92
92: def dtag(tag_to_del=None)
93: @c.dtag(@id, tag_to_del)
94: self
95: end
# File tk/canvastag.rb, line 111
111: def icursor(index)
112: @c.icursor(@id, index)
113: self
114: end
# File tk/canvastag.rb, line 120
120: def insert(beforethis, string)
121: @c.insert(@id, beforethis, string)
122: self
123: end
# File tk/canvastag.rb, line 125
125: def lower(belowthis=None)
126: @c.lower(@id, belowthis)
127: self
128: end
# File tk/canvastag.rb, line 130
130: def move(xamount, yamount)
131: @c.move(@id, xamount, yamount)
132: self
133: end
# File tk/canvastag.rb, line 135
135: def raise(abovethis=None)
136: @c.raise(@id, abovethis)
137: self
138: end
# File tk/canvastag.rb, line 140
140: def scale(xorigin, yorigin, xscale, yscale)
141: @c.scale(@id, xorigin, yorigin, xscale, yscale)
142: self
143: end
# File tk/canvastag.rb, line 145
145: def select_adjust(index)
146: @c.select('adjust', @id, index)
147: self
148: end
# File tk/canvastag.rb, line 149
149: def select_from(index)
150: @c.select('from', @id, index)
151: self
152: end