Lines Matching defs:Canvas
1 # This module exports classes for the various canvas item types
4 # It's best to use the Tkinter.Canvas class directly.
7 warnpy3k("the Canvas module has been removed in Python 3.0", stacklevel=2)
10 from Tkinter import Canvas, _cnfmerge, _flatten
14 def __init__(self, canvas, itemType, *args, **kw):
15 self.canvas = canvas
16 self.id = canvas._create(itemType, args, kw)
17 if not hasattr(canvas, 'items'):
18 canvas.items = {}
19 canvas.items[self.id] = self
25 del self.canvas.items[self.id]
26 self.canvas.delete(self.id)
28 v = self.canvas.tk.split(self.canvas.tk.call(
29 self.canvas._w, 'itemconfigure',
34 self.canvas.itemconfig(self.id, {key: value})
37 self._keys = map(lambda x, tk=self.canvas.tk:
39 self.canvas.tk.splitlist(
40 self.canvas._do(
49 self.canvas.addtag(tag, option, self.id)
51 x1, y1, x2, y2 = self.canvas.bbox(self.id)
54 return self.canvas.tag_bind(self.id, sequence, command, add)
56 self.canvas.tag_unbind(self.id, sequence, funcid)
58 return self.canvas.itemconfig(self.id, _cnfmerge((cnf, kw)))
62 return self.canvas.coords(self.id, *flat)
64 self.canvas.dchars(self.id, first, last)
66 self.canvas.dtag(self.id, ttd)
68 self.canvas.focus(self.id)
70 return self.canvas.gettags(self.id)
72 self.canvas.icursor(self.id, index)
74 return self.canvas.index(self.id, index)
76 self.canvas.insert(self.id, beforethis, string)
78 self.canvas.tag_lower(self.id, belowthis)
80 self.canvas.move(self.id, xamount, yamount)
82 self.canvas.tag_raise(self.id, abovethis)
85 self.canvas.scale(self.id, xorigin, yorigin, xscale, yscale)
87 return self.canvas.type(self.id)
90 def __init__(self, canvas, *args, **kw):
91 CanvasItem.__init__(self, canvas, 'arc', *args, **kw)
94 def __init__(self, canvas, *args, **kw):
95 CanvasItem.__init__(self, canvas, 'bitmap', *args, **kw)
98 def __init__(self, canvas, *args, **kw):
99 CanvasItem.__init__(self, canvas, 'image', *args, **kw)
102 def __init__(self, canvas, *args, **kw):
103 CanvasItem.__init__(self, canvas, 'line', *args, **kw)
106 def __init__(self, canvas, *args, **kw):
107 CanvasItem.__init__(self, canvas, 'oval', *args, **kw)
110 def __init__(self, canvas, *args, **kw):
111 CanvasItem.__init__(self, canvas, 'polygon', *args, **kw)
114 def __init__(self, canvas, *args, **kw):
115 CanvasItem.__init__(self, canvas, 'rectangle', *args, **kw)
119 def __init__(self, canvas, *args, **kw):
120 CanvasItem.__init__(self, canvas, 'text', *args, **kw)
123 def __init__(self, canvas, *args, **kw):
124 CanvasItem.__init__(self, canvas, 'window', *args, **kw)
127 def __init__(self, canvas, tag=None):
131 self.canvas = canvas
132 self.canvas.dtag(self.tag)
137 return self.canvas._do(cmd, (self.tag,) + _flatten(args))
153 return self.canvas._getints(self._do('bbox'))
155 return self.canvas.tag_bind(self.id, sequence, command, add)
157 self.canvas.tag_unbind(self.id, sequence, funcid)
169 return self.canvas.tk.splitlist(self._do('gettags', self.tag))
173 return self.canvas.tk.getint(self._do('index', index))
177 return self.canvas.itemconfigure(self.tag, _cnfmerge((cnf,kw)))
188 self.canvas._do('select', ('adjust', self.tag, index))
190 self.canvas._do('select', ('from', self.tag, index))
192 self.canvas._do('select', ('to', self.tag, index))