Lines Matching refs:cv
471 img = TK.PhotoImage(width=1, height=1, master=self.cv)
479 return TK.PhotoImage(file=filename, master=self.cv)
481 def __init__(self, cv):
482 self.cv = cv
483 if isinstance(cv, ScrolledCanvas):
484 w = self.cv.canvwidth
485 h = self.cv.canvheight
487 w = int(self.cv.cget("width"))
488 h = int(self.cv.cget("height"))
489 self.cv.config(scrollregion = (-w//2, -h//2, w//2, h//2 ))
495 """Create an invisible polygon item on canvas self.cv)
497 return self.cv.create_polygon((0, 0, 0, 0, 0, 0), fill="", outline="")
514 self.cv.coords(polyitem, *cl)
516 self.cv.itemconfigure(polyitem, fill=fill)
518 self.cv.itemconfigure(polyitem, outline=outline)
520 self.cv.itemconfigure(polyitem, width=width)
522 self.cv.tag_raise(polyitem)
525 """Create an invisible line item on canvas self.cv)
527 return self.cv.create_line(0, 0, 0, 0, fill="", width=2,
545 self.cv.coords(lineitem, *cl)
547 self.cv.itemconfigure(lineitem, fill=fill)
549 self.cv.itemconfigure(lineitem, width=width)
551 self.cv.tag_raise(lineitem)
557 self.cv.delete(item)
562 self.cv.update()
566 self.cv.after(delay)
572 rgb = self.cv.winfo_rgb(color)
582 self.cv.config(bg = color)
585 return self.cv.cget("bg")
596 item = self.cv.create_text(x-1, -y, text = txt, anchor = anchor[align],
598 x0, y0, x1, y1 = self.cv.bbox(item)
611 self.cv.tag_unbind(item, "<Button-%s>" % num)
614 x, y = (self.cv.canvasx(event.x)/self.xscale,
615 -self.cv.canvasy(event.y)/self.yscale)
617 self.cv.tag_bind(item, "<Button-%s>" % num, eventfun, add)
629 self.cv.tag_unbind(item, "<Button%s-ButtonRelease>" % num)
632 x, y = (self.cv.canvasx(event.x)/self.xscale,
633 -self.cv.canvasy(event.y)/self.yscale)
635 self.cv.tag_bind(item, "<Button%s-ButtonRelease>" % num,
648 self.cv.tag_unbind(item, "<Button%s-Motion>" % num)
652 x, y = (self.cv.canvasx(event.x)/self.xscale,
653 -self.cv.canvasy(event.y)/self.yscale)
657 self.cv.tag_bind(item, "<Button%s-Motion>" % num, eventfun, add)
669 self.cv.unbind("<Button-%s>" % num)
672 x, y = (self.cv.canvasx(event.x)/self.xscale,
673 -self.cv.canvasy(event.y)/self.yscale)
675 self.cv.bind("<Button-%s>" % num, eventfun, add)
682 self.cv.unbind("<KeyRelease-%s>" % key, None)
686 self.cv.bind("<KeyRelease-%s>" % key, eventfun)
695 self.cv.unbind("<KeyPress>", None)
697 self.cv.unbind("<KeyPress-%s>" % key, None)
702 self.cv.bind("<KeyPress>", eventfun)
704 self.cv.bind("<KeyPress-%s>" % key, eventfun)
709 self.cv.focus_force()
715 self.cv.after_idle(fun)
717 self.cv.after(t, fun)
722 return self.cv.create_image(0, 0, image=image)
729 self.cv.coords(item, (x * self.xscale, -y * self.yscale))
730 self.cv.itemconfig(item, image=image)
737 self.cv.itemconfig(item, image=image)
738 self.cv.tag_lower(item)
744 return self.cv.type(item)
754 cl = self.cv.coords(item)
759 self.cv.config(scrollregion=(srx1, sry1, srx2, sry2))
762 items = self.cv.find_all()
764 coordinates = list(self.cv.coords(item))
771 self.cv.coords(item, *newcoordlist)
778 if not isinstance(self.cv, ScrolledCanvas):
781 return self.cv.canvwidth, self.cv.canvheight
786 self.cv.reset(canvwidth, canvheight, bg)
791 width = self.cv.winfo_width()
793 width = self.cv['width']
794 height = self.cv.winfo_height()
796 height = self.cv['height']
812 self.cv.tk.mainloop()
827 return simpledialog.askstring(title, prompt, parent=self.cv)
849 parent=self.cv)
965 def __init__(self, cv, mode=_CFG["mode"],
967 TurtleScreenBase.__init__(self, cv)
1001 rootwindow = cv.winfo_toplevel()
1333 >>> cv = screen.getcanvas()
1334 >>> cv
1337 return self.cv
2532 if screen.cv == canvas: