def __init__(self, client, clientinlist, master=None):
Frame.__init__(self, master) # Create the main frame.
self.widthx = 300 # Width of the frame.
self.heighty = 100 # Height of the frame.
self.client = client # The client.
self.dim = "600x300" # Dimension of the panel.
self.ip = str(self.client.ip) # Ip of the client.
self.port = str(self.client.port) # Port of the client.
self.write = None
self.read = None
self.clientinlist = clientinlist
self.writetext = None
self.textarea = None
self.scroll = None
master.wm_title(self.ip + ":" + self.port) # Title of the window.
master.minsize(width=self.widthx, height=self.heighty) # Min size.
master.geometry(self.dim)
master.protocol("WM_DELETE_WINDOW", self.on_closing)
self.customFont = tkFont.Font(family="Monospace", size=12) # Set font family and text size.
self.read_write_panel() # Customize the frame by adding panel.
self.thread_start() # Start needed thread.
###############################################
# Text Panel used to show the client messages #
###############################################
评论列表
文章目录