代码拉取完成,页面将自动刷新
from tkinter import *
import UI
class BottomFrame(Frame):
coordLb = None
def __init__(self, canv, master=None):
Frame.__init__(self, master, relief=RAISED, borderwidth=2, bg=UI.bg, width=860, height=UI.bottomHeight)
self.canv = canv
self.initView()
self.canv.bind("<Motion>", self.showCoord)
def showCoord(self, event):
xx, yy = self.canv.getCoord()
ex, ey = self.canv.realCoord(event.x, event.y)
x = int((ex - xx) / self.canv.scale)
y = int((ey - yy) / self.canv.scale)
if self.canv.img is not None:
self.coordLb["text"] = "(%d , %d)" % (x, y)
else:
self.coordLb["text"] = ""
pass
def initView(self):
bcolor = UI.bg
fcolor = UI.fg
self.coordLb = Label(self, text="",
bg=bcolor, fg=fcolor,
width=20, height=1,
font=UI.font)
self.coordLb.place(x=10, y=1)
pass
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。