Module: TkcTagAccess

Includes:
TkComm, TkTreatTagFont
Included in:
TkcItem, TkcTag
Defined in:
lib/tk/canvastag.rb,
lib/tk/canvastag.rb

Constant Summary

Constants included from TkComm

TkComm::GET_CONFIGINFO_AS_ARRAY, TkComm::GET_CONFIGINFOwoRES_AS_ARRAY, TkComm::TkExtlibAutoloadModule, TkComm::Tk_CMDTBL, TkComm::Tk_IDs, TkComm::Tk_WINDOWS, TkComm::USE_TCLs_LIST_FUNCTIONS, TkComm::WidgetClassNames

Constants included from TkUtil

TkUtil::None, TkUtil::RELEASE_DATE

Instance Method Summary collapse

Methods included from TkTreatTagFont

#font_configinfo, #font_configure, #font_copy, #kanjifont_configure, #kanjifont_copy, #latinfont_configure, #latinfont_copy

Methods included from TkComm

_at, _callback_entry?, _callback_entry_class?, _curr_cmd_id, _fromUTF8, _genobj_for_tkwidget, _next_cmd_id, _toUTF8, array2tk_list, #bind_all, #bind_append_all, #bind_remove_all, #bindinfo_all, bool, image_obj, install_cmd, #install_cmd, list, num_or_nil, num_or_str, number, procedure, simplelist, slice_ary, string, #subst, tk_tcl2ruby, uninstall_cmd, #uninstall_cmd, window

Methods included from TkUtil

#_conv_args, _conv_args, #_fromUTF8, #_get_eval_enc_str, _get_eval_enc_str, #_get_eval_string, _get_eval_string, _symbolkey2str, #_symbolkey2str, #_toUTF8, #bool, bool, callback, eval_cmd, #hash_kv, hash_kv, install_cmd, #num_or_nil, num_or_nil, num_or_str, #num_or_str, number, #number, string, #string, uninstall_cmd, untrust

Methods included from TkEvent

#install_bind, #install_bind_for_event_class

Instance Method Details

#&(tag) ⇒ Object

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)"


190
191
192
193
194
195
196
# File 'lib/tk/canvastag.rb', line 190

def &(tag)
  if tag.kind_of? TkObject
    TkcTagString.new(@c, '(' + @id + ')&&(' + tag.path + ')')
  else
    TkcTagString.new(@c, '(' + @id + ')&&(' + tag.to_s + ')')
  end
end

#-@Object



214
215
216
# File 'lib/tk/canvastag.rb', line 214

def -@
  TkcTagString.new(@c, '!(' + @id + ')')
end

#^(tag) ⇒ Object



206
207
208
209
210
211
212
# File 'lib/tk/canvastag.rb', line 206

def ^(tag)
  if tag.kind_of? TkObject
    TkcTagString.new(@c, '(' + @id + ')^(' + tag.path + ')')
  else
    TkcTagString.new(@c, '(' + @id + ')^(' + tag.to_s + ')')
  end
end

#addtag(tag) ⇒ Object



16
17
18
19
# File 'lib/tk/canvastag.rb', line 16

def addtag(tag)
  @c.addtag(tag, 'withtag', @id)
  self
end

#bboxObject



21
22
23
# File 'lib/tk/canvastag.rb', line 21

def bbox
  @c.bbox(@id)
end

#bind(seq, *args, &block) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/tk/canvastag.rb', line 25

def bind(seq, *args, &block)
  # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
  if TkComm._callback_entry?(args[0]) || !block
    cmd = args.shift
  else
    cmd = block
  end
  @c.itembind(@id, seq, cmd, *args)
  self
end

#bind_append(seq, *args, &block) ⇒ Object



36
37
38
39
40
41
42
43
44
45
# File 'lib/tk/canvastag.rb', line 36

def bind_append(seq, *args, &block)
  # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
  if TkComm._callback_entry?(args[0]) || !block
    cmd = args.shift
  else
    cmd = block
  end
  @c.itembind_append(@id, seq, cmd, *args)
  self
end

#bind_remove(seq) ⇒ Object



47
48
49
50
# File 'lib/tk/canvastag.rb', line 47

def bind_remove(seq)
  @c.itembind_remove(@id, seq)
  self
end

#bindinfo(seq = nil) ⇒ Object



52
53
54
# File 'lib/tk/canvastag.rb', line 52

def bindinfo(seq=nil)
  @c.itembindinfo(@id, seq)
end

#cget(option) ⇒ Object



59
60
61
# File 'lib/tk/canvastag.rb', line 59

def cget(option)
  @c.itemcget(@id, option)
end

#cget_strict(option) ⇒ Object



62
63
64
# File 'lib/tk/canvastag.rb', line 62

def cget_strict(option)
  @c.itemcget_strict(@id, option)
end

#cget_tkstring(option) ⇒ Object



56
57
58
# File 'lib/tk/canvastag.rb', line 56

def cget_tkstring(option)
  @c.itemcget_tkstring(@id, option)
end

#configinfo(key = nil) ⇒ Object

end



74
75
76
# File 'lib/tk/canvastag.rb', line 74

def configinfo(key=nil)
  @c.itemconfiginfo(@id, key)
end

#configure(key, value = None) ⇒ Object



66
67
68
69
# File 'lib/tk/canvastag.rb', line 66

def configure(key, value=None)
  @c.itemconfigure(@id, key, value)
  self
end

#coords(*args) ⇒ Object



82
83
84
# File 'lib/tk/canvastag.rb', line 82

def coords(*args)
  @c.coords(@id, *args)
end

#current_configinfo(key = nil) ⇒ Object



78
79
80
# File 'lib/tk/canvastag.rb', line 78

def current_configinfo(key=nil)
  @c.current_itemconfiginfo(@id, key)
end

#dchars(first, last = None) ⇒ Object



86
87
88
89
# File 'lib/tk/canvastag.rb', line 86

def dchars(first, last=None)
  @c.dchars(@id, first, last)
  self
end

#dtag(tag_to_del = None) ⇒ Object Also known as: deltag



91
92
93
94
# File 'lib/tk/canvastag.rb', line 91

def dtag(tag_to_del=None)
  @c.dtag(@id, tag_to_del)
  self
end

#findObject Also known as: list



97
98
99
# File 'lib/tk/canvastag.rb', line 97

def find
  @c.find('withtag', @id)
end

#focusObject



102
103
104
# File 'lib/tk/canvastag.rb', line 102

def focus
  @c.itemfocus(@id)
end

#gettagsObject



106
107
108
# File 'lib/tk/canvastag.rb', line 106

def gettags
  @c.gettags(@id)
end

#icursor(index) ⇒ Object



110
111
112
113
# File 'lib/tk/canvastag.rb', line 110

def icursor(index)
  @c.icursor(@id, index)
  self
end

#imove(idx, x, y) ⇒ Object Also known as: i_move



115
116
117
118
119
# File 'lib/tk/canvastag.rb', line 115

def imove(idx, x, y)
  # Tcl/Tk 8.6 or later
  @c.imove(@id, idx, x, y)
  self
end

#index(idx) ⇒ Object



122
123
124
# File 'lib/tk/canvastag.rb', line 122

def index(idx)
  @c.index(@id, idx)
end

#insert(beforethis, string) ⇒ Object



126
127
128
129
# File 'lib/tk/canvastag.rb', line 126

def insert(beforethis, string)
  @c.insert(@id, beforethis, string)
  self
end

#itemtypeObject



179
180
181
# File 'lib/tk/canvastag.rb', line 179

def itemtype
  @c.itemtype(@id)
end

#lower(belowthis = None) ⇒ Object



131
132
133
134
# File 'lib/tk/canvastag.rb', line 131

def lower(belowthis=None)
  @c.lower(@id, belowthis)
  self
end

#move(xamount, yamount) ⇒ Object



136
137
138
139
# File 'lib/tk/canvastag.rb', line 136

def move(xamount, yamount)
  @c.move(@id, xamount, yamount)
  self
end

#moveto(x, y) ⇒ Object Also known as: move_to



141
142
143
144
145
# File 'lib/tk/canvastag.rb', line 141

def moveto(x, y)
  # Tcl/Tk 8.6 or later
  @c.moveto(@id, x, y)
  self
end

#raise(abovethis = None) ⇒ Object



148
149
150
151
# File 'lib/tk/canvastag.rb', line 148

def raise(abovethis=None)
  @c.raise(@id, abovethis)
  self
end

#rchars(first, last, str_or_coords) ⇒ Object Also known as: replace_chars, replace_coords



158
159
160
161
162
# File 'lib/tk/canvastag.rb', line 158

def rchars(first, last, str_or_coords)
  # Tcl/Tk 8.6 or later
  @c.rchars(@id, first, last, str_or_coords)
  self
end

#scale(xorigin, yorigin, xscale, yscale) ⇒ Object



153
154
155
156
# File 'lib/tk/canvastag.rb', line 153

def scale(xorigin, yorigin, xscale, yscale)
  @c.scale(@id, xorigin, yorigin, xscale, yscale)
  self
end

#select_adjust(index) ⇒ Object



166
167
168
169
# File 'lib/tk/canvastag.rb', line 166

def select_adjust(index)
  @c.select('adjust', @id, index)
  self
end

#select_from(index) ⇒ Object



170
171
172
173
# File 'lib/tk/canvastag.rb', line 170

def select_from(index)
  @c.select('from', @id, index)
  self
end

#select_to(index) ⇒ Object



174
175
176
177
# File 'lib/tk/canvastag.rb', line 174

def select_to(index)
  @c.select('to', @id, index)
  self
end

#|(tag) ⇒ Object



198
199
200
201
202
203
204
# File 'lib/tk/canvastag.rb', line 198

def |(tag)
  if tag.kind_of? TkObject
    TkcTagString.new(@c, '(' + @id + ')||(' + tag.path + ')')
  else
    TkcTagString.new(@c, '(' + @id + ')||(' + tag.to_s + ')')
  end
end