def add_friend():
def send_message():
msgcontent = '?:'+ time.strftime("%Y-%m-%d %H:%M:%S",time.localtime()) + '\n '
text_msglist_child.insert(END, msgcontent, 'green')
text_msglist_child.insert(END, text_msg_child.get('0.0', END))
data=text_msg_child.get('0.0', END)
text_msg_child.delete('0.0', END)
data2='03#'+temp+'#'+data+'#'
ADDR = ('202.114.196.97', 11560)
udpCliSock.sendto(data2.encode('utf-8'), ADDR)
data3, ADDR = udpCliSock.recvfrom(1024)
text_msglist_child.insert(END,'????'+data3+'\n')
temp=friend_account.get()
if temp=='':
tkMessageBox.showinfo('??','??????????')
return
friend_account.set('')
#???
child=Toplevel()
child.title(temp)
frame_left_top = Frame(child,width=380, height=270, bg='white')
frame_left_center = Frame(child,width=380, height=50, bg='white')
frame_left_top.grid(row=0, column=0, padx=2, pady=5)
frame_left_center.grid(row=1, column=0, padx=2, pady=5)
frame_left_top.grid_propagate(0)
frame_left_center.grid_propagate(0)
text_msglist_child= Text(frame_left_top)
text_msg_child= Text(frame_left_center)
text_msglist_child.grid()
text_msg_child.grid()
Button(child, text='??',command=send_message).grid(row=2,column=0,sticky=W)
评论列表
文章目录