def __init__(self, parent, width, height): Tab.__init__(self, parent, width, height) self.width = width self.height = height self.padding = 10 self.tableWidth = self.width / 3 self.tableHeight = self.height / 2 self.playersTab = None self.columnconfigure(3, minsize=self.tableWidth) self.tables = [ Table(self, self.tableWidth, self.tableHeight, 1), Table(self, self.tableWidth, self.tableHeight, 2), Table(self, self.tableWidth, self.tableHeight, 3), Table(self, self.tableWidth, self.tableHeight, 4) ] self.tables[0].grid(row=0, column=0) self.tables[1].grid(row=0, column=1) self.tables[2].grid(row=1, column=0) self.tables[3].grid(row=1, column=1) self.tableView = ttk.Frame(self) self.textFont = font.Font(size=32) self.label = tk.Label(self.tableView, text="Table #:", font=self.textFont) self.label.grid(row=0, column=0) self.tableNumber = tk.Label(self.tableView) self.listHeight = int(self.height / 18) self.listWidth = int(self.width / 18) self.playerList = tk.Listbox(self.tableView, width=self.listWidth, height=self.listHeight, activestyle="none") self.playerList.grid(row=1, column=0) self.tableView.grid(row=0, column=2, rowspan=2, columnspan=2)
def __init__(self, parent, width, height): Tab.__init__(self, parent, width, height) self.width = width self.height = height self.playersAmount = len(self.players) self.playersLists = [] self.isShuffled = False self.listOfPlayers = tk.Listbox(self, font="Times 16", height=int(self.height / 24), width=int(self.width / 20), activestyle="none") for i in range(len(self.players)): self.listOfPlayers.insert(i, self.players[i]) self.listOfPlayers.grid(row=0, column=0) self.panel = ttk.Frame(self) self.adding = ttk.Frame(self.panel) self.addLabel = tk.Label(self.adding, text="Player name:", font="Times 16") self.addLabel.grid(row=0, column=0, padx=20) self.addField = tk.Entry(self.adding, font="Times 16") self.addField.grid(row=0, column=1) self.addButton = tk.Button(self.adding, text="Add", font="Times 16", command=self.addPlayer) self.addButton.grid(row=1, column=0, ipadx=15) self.adding.grid(row=0, column=0, pady=150) self.removing = ttk.Frame(self.panel) self.removeLabel = tk.Label(self.removing, text="Player name:", font="Times 16") self.removeLabel.grid(row=0, column=0, padx=20) self.removeField = tk.Entry(self.removing, font="Times 16") self.removeField.grid(row=0, column=1) self.removeButton = tk.Button(self.removing, text="Remove", font="Times 16", command=self.removePlayer) self.removeButton.grid(row=1, column=0) self.removing.grid(row=2, column=0, pady=150) self.shuffleButton = tk.Button(self.panel, text="Shuffle", font="Times 16", command=self.shuffle) self.shuffleButton.grid(row=4, column=3, ipady=10, ipadx=25, padx=20) self.panel.grid(row=0, column=1, rowspan=2, columnspan=3)
def __init__(self, tab_option, font, parent): Tab.__init__(self, tab_option) self.build_log() # Logs history self.history = [] self.history.append("Program Started Successfully") self.parent = parent self.tracker = 0 # Set font self.font = font # Automatically open when a message is sent to the log self.auto = True
def __init__(self, parent, width, height): Tab.__init__(self, parent, width, height) self.width = width self.height = height self.currentLevel = 0 self.maxLevel = len(self.levels) self.timerTitle = tk.Label(self, text="Timer", font=self.topFont) self.timerTitle.grid(row=1, column=2, columnspan=4, ipady=40) self.timer = tk.Label(self, text="0 : 0", font=self.topFont, borderwidth=2, relief="groove") self.timer.grid(row=3, column=2, columnspan=4, ipady=10, ipadx=10) self.level = tk.Label(self, text=self.levels[self.currentLevel], font=self.midFont, width=30) self.level.grid(row=5, column=0, rowspan=1, columnspan=9, pady=180) self.minLbl = tk.Label(self, text="Min: ", font=self.botFont, padx=20) self.minLbl.grid(row=7, column=0, ipady=40, ipadx=10) self.minTbox = tk.Entry(self, font=self.botFont, width="5") self.minTbox.grid(row=7, column=1, ipady=10, ipadx=5) self.secLbl = tk.Label(self, text="Sec: ", font=self.botFont, padx=20) self.secLbl.grid(row=7, column=2, ipady=40, ipadx=10) self.secTbox = tk.Entry(self, font=self.botFont, width="5") self.secTbox.grid(row=7, column=3, ipady=10, ipadx=5) self.startButton = tk.Button(self, text="Start", font=self.botFont, command=self.start) self.startButton.grid(row=7, column=4, ipady=10, ipadx=15, padx=20) self.stopButton = tk.Button(self, text="Stop", font=self.botFont, command=self.stop, state="disabled") self.stopButton.grid(row=7, column=5, ipady=10, ipadx=15, padx=20) self.resetButton = tk.Button(self, text="Reset", font=self.botFont, command=self.reset, state="disabled") self.resetButton.grid(row=7, column=6, ipady=10, ipadx=15, padx=20)
def __init__(self, tab_option, parent): Tab.__init__(self, tab_option) self.build_options() self.parent = parent self.target_decay_rate = 0