def __init__(self,master): self.master = master Gstyle = ttk.Style() Gstyle.configure("TNotebook", background="#121A16", borderwidth=0) Gstyle.configure("TNotebook.Tab", background='#545854',foreground="black",borderwidth=1) self.nb = ttk.Notebook(master,style='TNotebook') self.nb.place(x=122, y=0) self.userWindow = Listbox(master, width=15,height=24) self.userWindow.config(background="#121A16",foreground="#00EB00",highlightthickness=0) self.userWindow.place(x=0,y=23) self.roomWindow = Listbox(master, width=15,height=24) self.roomWindow.config(background="#121A16",foreground="#00EB00",highlightthickness=0) self.roomWindow.place(x=689,y=23) self.roomLabel = Label(master,text="Available Rooms",font=("Helvetica",10)) self.roomLabel.config(background="#121A16",foreground="#00EB00") self.roomLabel.place(x=695,y=0) self.userLabel = Label(master,text="Users",font=("Helvetica",10)) self.userLabel.config(background="#121A16",foreground="#00EB00") self.userLabel.place(x=30,y=0) self.temp = StringVar() self.message = Entry(master,width=70,textvariable = self.temp) self.message.config(background = "#121A16",foreground="#00EB00",insertbackground="#00EB00") self.message.place(x=123,y=388) self.message.bind('<Return>',self.sendMessage) self.windowList = {} self.userList = {} self.rooms = {} self.configList = {} self.userList["global"] = [''] self.socketStatus = "disconnected" self.initiateConfig() self.currentTab = "global" self.nb.bind_all("<<NotebookTabChanged>>", lambda e: TabUtils.tabChangedEvent(e,gui)) self.serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.master.protocol('WM_DELETE_WINDOW', lambda: ConnectionUtils.closeClient(self)) self.menues = Menues(self) TabUtils.addTab(self,"global")
def invited(gui,arguments): if(MiscUtils.noDuplicate(gui.windowList,arguments)): TabUtils.addTab(gui,arguments)
def success(gui,arguments): command = MiscUtils.messageSplit(arguments) gui.rooms[command[0]] = [command[0],command[1]] TabUtils.addTab(gui,command[0])