在tkinter上看不到串行缓冲区的最后两行

我正在尝试从串行com读取缓冲区。 我正在使用以下方法,但在文本区域中却看不到最后两行。 当我断开串行连接时,两条线突然出现。 您能告诉我代码有什么问题吗? 谢谢。

代码:

# scrolled text box used to display the serial data

win.configure(background="gray14")

frame1 = tk.Frame(win,width=75,height=120,bg = '#ffffff',borderwidth=1,relief="sunken")
scrollbar = tk.Scrollbar(frame1) 
editArea = tk.Text(frame1,height=33,wrap="word",yscrollcommand=scrollbar.set,font("Helvetica",11),fg='#ffffff',highlightthickness=0,background="gray34")
scrollbar.config(command=editArea.yview)
scrollbar.pack(side="right",fill="y")
editArea.pack(side="left",fill="both",expand=True)
editArea.yview_pickplace("end")
editArea.see("end")
frame1.place(x=10,y=30)


# serial data callback function

def OnReceiveSerialData(message):
    str_message = message.decode("utf-8")
    editArea.insert("end",str_message)
    editArea.see(END)
siqi111 回答:在tkinter上看不到串行缓冲区的最后两行

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3154693.html

大家都在问