def pointWinSetup(self): #Setting up the running total of points window pointsWin = Toplevel(self._root) pointsWin.title('Score') self._pointsWin = pointsWin Grid.rowconfigure(pointsWin, 0, weight=1) Grid.columnconfigure(pointsWin, 0, weight=1) frame = Frame(pointsWin) frame.grid(row=0, column=0, sticky=N + S + E + W) self._points = [None, None] self._points[0] = StringVar() self._points[0].set( f'{self._game.getP1Name()}: {self._game.getScore(self._game.getP1Name())}' ) self._points[1] = StringVar() self._points[1].set( f'{self._game.getP2Name()}: {self._game.getScore(self._game.getP2Name())}' ) l = Label(frame, textvariable=self._points[0]) l.grid(row=1, column=0, sticky=N + S + E + W) l = Label(frame, textvariable=self._points[1]) l.grid(row=2, column=0, sticky=N + S + E + W) self._turn = StringVar() self._turn.set(f'{self._game.getPlayer()}\'s turn') l = Label(frame, textvariable=self._turn) l.grid(row=0, column=0, sticky=N + S + E + W)
def __init__(self, **kwargs): super().__init__(**kwargs) self._isReady = False Grid.rowconfigure(self, 0, weight=1) Grid.columnconfigure(self, 0, weight=1) # Create a list of all available parsers and their class objects self._pList = [ (name, parser()) for name, parser in inspect.getmembers( parsers, inspect.isclass) if issubclass(parser, parsers.Parser) and name != 'Parser' ] plugins = _utils.findPlugins('Parser') self._pList.extend(((name, parser()) for name, parser in plugins)) # value = 1 prevents PositionParser's config window from opening v = IntVar(value=1) parent = self.master for index, (text, _) in enumerate(self._pList): b = Radiobutton( self, text=text, variable=v, value=index, command=lambda: self._configureParser(v, parent)) b.grid(row=index, column=0, sticky=W) # Intialize the parser contained by the LabelFrame self._configureParser(v, parent) self._isReady = True
def __init__(self, root): self.root = root tkinter.PanedWindow.__init__(self, root, {'orient': tkinter.VERTICAL}) self.main_label = tkinter.Label(self, text="Solution: ", justify=tkinter.CENTER, anchor=tkinter.CENTER, font="Verdana 12 bold") self.iter_num_label = tkinter.Label(self, text="Number of iterations: ") self.end_condition = tkinter.Label(self, text="End condition triggered: ") self.total_cost = tkinter.Label(self, text="Total cost: ") self.main_label.grid(row=0, column=0, columnspan=2, **self.label_opts) self.iter_num_label.grid(row=1, column=0, **self.label_opts) self.end_condition.grid(row=2, column=0, **self.label_opts) self.total_cost.grid(row=3, column=0, **self.label_opts) for row_index in range(4): Grid.rowconfigure(self, row_index, weight=1) for col_index in range(2): Grid.columnconfigure(self, col_index, weight=1)
def __init__(self, controller, model): self.controller = controller self.model = model self.controller = controller self.model = model self.root = controller.root Grid.rowconfigure(self.root, 0, weight=1) Grid.columnconfigure(self.root, 1, weight=1) self.root.minsize(width=800, height=600) self.root.maxsize(width=800, height=600) self.root.resizable(False, False) # MENU BAR self.menuBar = MenuBar(self.root) # CANVAS self.canvas = SCanvas(self.root) # INPUT PANEL self.inputPanel = InputPanel(self) self.inputPanel.sailCombobox['values'] = ("New...") self.inputPanel.sailCombobox.current(0)
def __init__(self, **kwargs): super().__init__(**kwargs) self._isReady = False Grid.rowconfigure(self, 0, weight = 1) Grid.columnconfigure(self, 0, weight = 1) # Create a list of all available parsers and their class objects self._pList = [(name, parser()) for name, parser in inspect.getmembers(parsers, inspect.isclass) if issubclass(parser, parsers.Parser) and name != 'Parser'] plugins = _utils.findPlugins('Parser') self._pList.extend(((name, parser()) for name, parser in plugins)) # value = 1 prevents PositionParser's config window from opening v = IntVar(value = 1) parent = self.master for index, (text, _) in enumerate(self._pList): b = Radiobutton( self, text=text, variable = v, value=index, command = lambda: self._configureParser(v, parent)) b.grid(row = index, column = 0, sticky = W) # Intialize the parser contained by the LabelFrame self._configureParser(v, parent) self._isReady = True
def update(self): if self.auto_push: self.push() for y in range(self.height + 1): Grid.rowconfigure(self, y, weight=1) self.after(50, self.update)
def play_callback(self): if self.game_win: return None self.game = Game() game_win = Toplevel(self._root) self.game_win = game_win game_win.title("Game") Grid.rowconfigure(game_win, 0, weight = 1) Grid.columnconfigure(game_win, 0, weight = 1) frame = Frame(game_win) frame.grid(row = 0, column = 0) self._buttons = [[None for _ in range (Game.dimension)] for _ in range (Game.dimension)] for row, column in product(range(Game.dimension), range(Game.dimension)): b = StringVar() b.set(self.game.at(row+1, column+1)) cmd = lambda r=row, c=column : self.play_and_refresh(r, c) Button( frame, textvariable = b, command=cmd ).grid(row = row, column = column) self._buttons[row][column] = b Button(game_win, text="Dismiss", command=self.game_close).grid(row=1, column = 0)
def createWindow(self): self.window = Toplevel(self.app) self.window.title('Search') self.window.protocol("WM_DELETE_WINDOW", self.handleClose) self.input = Entry(self.window, textvariable=self.regex) self.input.grid(row=0, column=0) self.input.bind('<Return>', self.search) self.input.bind('<Escape>', lambda ev: self.window.focus()) self.searchButton = Button(self.window, text='Search', command=self.search, takefocus=0) self.searchButton.grid(row=0, column=1) self.resultCount = Label(self.window, text='0 results') self.resultCount.grid(row=0, column=2) cols = ('File', 'Tier', 'Time', 'Text') self.scroll = Scrollbar(self.window, orient='vertical') self.resultList = Treeview(self.window, columns=cols, show="headings", yscrollcommand=self.scroll.set, selectmode='browse') self.scroll.config(command=self.resultList.yview) for col in cols: self.resultList.heading(col, text=col) self.resultList.grid(row=2, column=0, columnspan=3, sticky='news') self.resultList.bind('<Double-1>', self.onClick) Grid.rowconfigure(self.window, 2, weight=1) Grid.columnconfigure(self.window, 0, weight=1) self.scroll.grid(row=2, column=3, sticky='ns')
def __init__(self, root, username): self.client = None self.frame = Frame(root) self.username = username self.put_message_lock = Lock() self.channel_name_to_messages = dict() self.channel_name_to_input_field = dict() self.channel_name_to_input_user = dict() self.channels = set() Grid.columnconfigure(self.frame, 0, weight=2) Grid.columnconfigure(self.frame, 1, weight=0) Grid.rowconfigure(self.frame, 0, weight=2) Grid.rowconfigure(self.frame, 1, weight=0) Grid.rowconfigure(self.frame, 2, weight=0) self.tab_parent = ttk.Notebook(self.frame) self.tab_parent.grid(row=0, column=0) self.configure_tab('saved messages') self.frame.pack(fill=BOTH, expand=YES) self.input_channel_name = StringVar() self.input_channel_name_field = Entry(self.frame, text=self.input_channel_name) self.input_channel_name_field.grid(row=2, column=0, sticky=W+E+S) self.subscribe_button = Button(self.frame, text="Subscribe", command=self.subscribe) self.subscribe_button.grid(row=2, column=0, sticky=S + E)
def loadApp(self, repositoryDirectory, appDirectory): if os.path.isdir(os.path.join(repositoryDirectory, appDirectory)): configFilePath = os.path.normpath(repositoryDirectory + '/' + appDirectory + '/launcher.json') if os.path.exists(configFilePath): gameConfig = Config() try: gameConfig.load(configFilePath) gameButton = self.launcherWindow.getAppButton( appDirectory, gameConfig) rawRow = (self.index + 1) / self.rowLength currentRow = math.ceil(rawRow) self.launcherWindow.frame.rowconfigure(currentRow) Grid.rowconfigure(self.launcherWindow.frame, currentRow) gameButton.grid(row=int(currentRow), column=self.currentColumn, sticky=N + S + E + W) if self.currentColumn == self.rowLength: self.currentColumn = 0 self.currentColumn += 1 self.index += 1 except Exception as e: print("Problem loading") print(e) pass
def cria_frames(self): " Cria todos os objetos Frame e posiciona no Grid " # Frame principal que contem todos os outros self.main_frame = Frame(self.tk, bg=cor_fundo) self.main_frame.pack(fill=BOTH, expand=True) Grid.columnconfigure(self.main_frame, 1, weight=1) Grid.rowconfigure(self.main_frame, 0, weight=1) # Frame com os botoes do lado esquerdo self.frame_botoes_geral = Frame(self.main_frame, bg=cor_fundo) self.frame_botoes_geral.grid(row=0, column=0, padx=20, pady=20, sticky=NS) # Frame com o logo e os botões pros problemas self.frame_botoes = Frame(self.frame_botoes_geral, bg=cor_fundo) self.frame_botoes.pack(side=TOP) # Frame com o canvas self.frame_canvas = Frame(self.main_frame, pady=20, bg=cor_fundo) self.frame_canvas.grid(row=0, column=1, sticky=N + S + E + W) # Frame com os arquivos self.frame_arquivos = Frame(self.main_frame, bg=cor_fundo) self.frame_arquivos.grid(row=0, column=2, padx=20, pady=20, sticky=N)
def initUI(self): Grid.columnconfigure(self, 0, weight=1) self.FilePathEntry = Entry(self) self.FilePathEntry.delete(0, END) self.FilePathEntry.insert(0, self.fname) self.FilePathEntry.grid(row=0, column=0, padx=5, sticky=E + W) options = readers.options self.csvType = StringVar() ftype = identifyImportType(self.fname) print(ftype) if ftype is not None: if ftype in options: self.csvType.set(ftype) self.typeSelection = OptionMenu(self, self.csvType, *options) self.typeSelection.grid(row=0, column=1, padx=5) self.scanButton = Button(self, text='Import', command=self.importFile) self.scanButton.grid(row=0, column=2, padx=5) self.removeButton = Button(self, text='Remove', command=self.remove) self.removeButton.grid(row=0, column=3, padx=5) self.pbar = Progressbar(self, orient='horizontal', mode='determinate') self.pbar.grid(row=1, columnspan=4, sticky=E + W)
def __init__(self, master): data_row = 0 nominal_flist_row = 1 adverse_flist_row = 2 last_row = 3 label_column = 0 filelist_column = 1 button_column = 2 self.copy_or_move = IntVar() self.copy_or_move.set(1) self.checkbutton = Checkbutton(master,text="Copy",variable = self.copy_or_move).grid(row=last_row) self.use_filelists = IntVar() self.use_filelists.set(0) self.filelist_check = Checkbutton(master,text="Filelists", command = self.list_swap, variable = self.use_filelists) self.filelist_check.grid(row = last_row,column = button_column) self.default_adverse_filelist_path = "" self.default_nominal_filelist_path = "" self.default_adverse_folder_path = "" self.default_nominal_folder_path = "" self.folder_label = Label(master, text="Data Folder:") self.folder_label.grid(row=data_row) self.nominal_filelist_label = Label(master, text="Nominal Directory:") self.nominal_filelist_label.grid(row=nominal_flist_row,column = label_column) self.adverse_filelist_label = Label(master, text="Adverse Directory:") self.adverse_filelist_label.grid(row=adverse_flist_row,column = label_column) #Define the entry fields self.data_folder_entry = Entry(master) self.nominal_path_entry = Entry(master) self.adverse_path_entry = Entry(master) Grid.columnconfigure(master,filelist_column,weight=1) self.data_folder_entry.grid(row=data_row, column=filelist_column,sticky = 'we') self.nominal_path_entry.grid(row=nominal_flist_row, column=filelist_column,sticky = 'we') self.adverse_path_entry.grid(row = adverse_flist_row, column = filelist_column,sticky = 'we') #define the "choose file" button self.data_folder_button = Button(master,text="Choose Folder", command = self.get_the_folder) self.nominal_filelist_button = Button(master,text="Choose Folder", command = self.get_nominal_filelist) self.adverse_filelist_button = Button(master,text="Choose Folder", command = self.get_adverse_filelist) self.data_folder_button.grid(row=data_row,column=button_column) self.nominal_filelist_button.grid(row=nominal_flist_row,column=button_column) self.adverse_filelist_button.grid(row=adverse_flist_row,column=button_column) self.save_button = Button(master,text="Generate Folder Hierarchy",fg ="#8b0000" , command = self.generate_folder_structure) self.save_button.grid(row = last_row,column = filelist_column)
def place_item(self, item): item.grid(row=self.row_now, column=0, padx=BTN_PAD_X, pady=BTN_PAD_Y, sticky=STICK_ALL) Grid.rowconfigure(self, self.row_now, weight=1) self.row_now += 1
def create_widgets(self): self.note = NoteVi(master=self, takefocus=0) self.note.grid(row=0, sticky='wens') self.status = StatusBar(master=self) self.status.grid(row=2, sticky='we') Grid.rowconfigure(self, 0, weight=1) Grid.columnconfigure(self, 0, weight=1)
def __init__(self, serviceLocator): self.serviceLocator = serviceLocator self.root = serviceLocator.root self.menu = LauncherMenu(serviceLocator) self.root.title("Game Launcher") Grid.rowconfigure(self.root, 0, weight=1) Grid.columnconfigure(self.root, 0, weight=1) scrolledWindow = ScrolledWindow(self.root) self.frame = Frame(scrolledWindow.scrollwindow, bg=Color.background) self.frame.grid(row=0, column=0, sticky=N + S + E + W)
def __init__(self, parent=None, cols=None, row_height=22): Frame.__init__(self, parent) self._rows = [] self._row_height = row_height self._cols = cols self._on_select_callback = None self._on_change_callback = None self._init_header(self._cols) self._last_selected = None # expand last column to fill width Grid.columnconfigure(self, len(cols) - 1, weight=1)
def fill_panel(self, panel): buttons = [] for i in range(4): Grid.columnconfigure(panel, i, weight=1) for j in range(2): Grid.rowconfigure(panel, j, weight=1) btn = LinkButton(self, panel, text=f"({i}, {j})") btn.link = None btn.grid(row=i, column=j, sticky=NSEW, padx=PAD, pady=PAD) buttons.append(btn) return buttons
def __init__(self,parent): number_of_buttons = 4 Canvas_top_menu = tk.Canvas(parent) Canvas_top_menu.grid(row=0,column=0,columnspan=4, sticky=E+W ) for i in range(0,number_of_buttons): Grid.columnconfigure(Canvas_top_menu, i, weight=1) #tk.Frame.__init__(self) tk.Button(Canvas_top_menu, text = 'Home', command = lambda: parent.show_frame('HomePage') ).grid( row=0,column=0,sticky=E+W ) tk.Button(Canvas_top_menu, text = 'Hinge Prediction', command = lambda: parent.show_frame('HingePrediction') ).grid( row=0,column=1,sticky=E+W ) tk.Button(Canvas_top_menu, text = 'hdANM', command = lambda: parent.show_frame('hdANM_GUI') ).grid( row=0,column=2,sticky=E+W ) tk.Button(Canvas_top_menu, text = 'Packing Entropy (Voronoi)', command = lambda: parent.show_frame('Voronoi_Packing_Entropy_GUI') ).grid( row=0,column=3,sticky=E+W )
def __init__(self, master=None): tk.Frame.__init__(self, master) self.buttons = [] self.grid() self.createWidgets() for i in range(WIDTH): Grid.columnconfigure(self, i, weight=1) for i in range(HEIGHT+1): Grid.rowconfigure(self, i, weight=1) self.createBoard()
def init_gui(self): self.top_level.geometry("600x750") Label(self.top_level, text=self.product.title).grid(row=0, column=0, columnspan=2) # May want to customize in near future link_label = Label(self.top_level, text="Emag - Link to shop", fg="blue", cursor="hand2") link_label.grid(row=1, column=0, columnspan=2) link_label.bind('<Button-1>', self.open_browser) img_data = self.service.get_image(self.product._id) self.img = ImageTk.PhotoImage( Image.open(BytesIO(img_data)).resize((150, 150))) panel = Label(self.top_level, image=self.img) panel.grid(row=2, column=0, rowspan=2) self.current_price_label = Label(self.top_level) self.current_price_label.grid(row=3, column=1) self.best_price_label = Label(self.top_level) self.best_price_label.grid(row=2, column=1) self.set_price_labels() monitoring_status = 'This device is being monitored' if self.product.monitored else 'This device is not being monitored' fg = 'green' if self.product.monitored else 'red' self.monitor_label = Label(self.top_level, text=monitoring_status, fg=fg) self.monitor_label.grid(row=4, column=1) text_bu = 'Turn off' if self.product.monitored else 'Turn on' self.monitor_bu = Button(self.top_level, text=text_bu, command=self.set_monitoring) self.monitor_bu.grid(row=4, column=0) self.set_price_plot() Button(self.top_level, text='Remove product').grid(row=6, column=0, columnspan=2) for x in range(7): Grid.rowconfigure(self.top_level, x, weight=1) for x in range(2): Grid.columnconfigure(self.top_level, x, weight=1)
def __init__(self): self._root = Tk() self._root.geometry("500x400") self._root.title("IMGPDF") self._Elements() Grid.rowconfigure(self._root, 0, weight=1) Grid.columnconfigure(self._root, 0, weight=1) self.supportedfiles = [ ('PDF files', '*.pdf*'), ('jpg files', '*.jpg*'), ('png files', '*.png*'), ('gif files', '*.gif*'), ('All files', '*.*') ] self.openfiles = [] self._root.mainloop()
def play_callback(self): if self._game_window: return self._game = Game() game_window = Toplevel(self._root) self._game_window = game_window game_window.title("Tic Tac Toe - Game") Grid.rowconfigure(game_window, 0, weight=1) Grid.columnconfigure(game_window, 0, weight=1) frame = Frame(game_window) frame.grid(row=0, column=0, sticky=N + S + E + W) dim = Game.DIM self._buttons = [[None for _ in range(dim)] for _ in range(dim)] for row, col in product(range(dim), range(dim)): b = StringVar() b.set(self._game.at(row + 1, col + 1)) cmd = lambda r=row, c=col: self.play_and_refresh(r, c) Button(frame, textvariable=b, command=cmd).grid(row=row, column=col, sticky=N + S + E + W) self._buttons[row][col] = b for i in range(dim): Grid.rowconfigure(frame, i, weight=1) Grid.columnconfigure(frame, i, weight=1) Button(game_window, text="Dismiss", command=self._game_close).grid(row=1, column=0)
def play_callback(self): if self._game_win: return self._game = Game() self._finished = False game_win = Toplevel(self._root) self._game_win = game_win game_win.title('Game') Grid.rowconfigure(game_win, 0, weight=1) Grid.columnconfigure(game_win, 0, weight=1) frame = Frame(game_win) frame.grid(row=0, column=0, sticky=N + S + E + W) self._buttons = [[None for _ in range(Game.DIM)] for _ in range(Game.DIM)] for row, col in product(range(Game.DIM), range(Game.DIM)): b = StringVar() b.set(self._game.at(row + 1, col + 1)) cmd = lambda r=row, c=col: self.play_and_refresh(r, c) Button(frame, textvariable=b, command=cmd).grid(row=row, column=col, sticky=N + S + E + W) self._buttons[row][col] = b for i in range(Game.DIM): Grid.rowconfigure(frame, i, weight=1) Grid.columnconfigure(frame, i, weight=1) Button(game_win, text='Dismiss', command=self._game.close).grid(row=1, column=0)
def __init__(self, root, username, sender): self.frame = Frame(root) self.username = username self.sender = sender self.put_message_lock = Lock() Grid.columnconfigure(self.frame, 0, weight=2) Grid.columnconfigure(self.frame, 1, weight=0) Grid.rowconfigure(self.frame, 0, weight=2) Grid.rowconfigure(self.frame, 1, weight=0) self.scrollbar = Scrollbar(self.frame) self.messages = Listbox(self.frame, yscrollcommand=self.scrollbar.set, height=15, width=50) self.scrollbar.grid(row=0, column=1, sticky=N + S) self.messages.grid(row=0, column=0, sticky=N + S + W + E) self.scrollbar.config(command=self.messages.yview) self.input_user = StringVar() self.input_field = Entry(self.frame, text=self.input_user) self.input_field.grid(row=1, column=0, sticky=W + E + S) self.send_button = Button(self.frame, text="Send", command=self.send_message) self.send_button.grid(row=1, column=1, sticky=S) self.input_field.bind("<Return>", lambda key: self.send_message()) self.frame.pack(fill=BOTH, expand=YES) self.input_field.focus()
def __init__(self, master): self.master = master self.master.geometry("270x270") self.frame = tk.Frame(self.master) self.prediction_dataset = None Label(self.frame, text="Main Menu", font='Helvetica 10 bold').grid(row=0, column=1, columnspan=3, sticky=N + S + E + W, pady=3) Label(self.frame, text="Mode:").grid(row=1, column=1, sticky=N + S + E + W, pady=3) self.mode_box = ttk.Combobox(self.frame, state="readonly", values=["DoS", "Mechanical"]) self.mode_box.current(0) self.mode_box.grid(row=1, column=2, columnspan=2, stick=N + S + E + W, pady=3) Button(self.frame, text='Composition Scan', command=self.compositionFrame).grid(row=2, column=1, columnspan=3, rowspan=2, sticky=N + S + E + W, pady=3) Button(self.frame, text="Predict Output", command=self.openPredictionThread).grid(row=4, column=1, columnspan=3, rowspan=2, sticky=N + S + E + W, pady=3) # Formatting for x in range(5): Grid.columnconfigure(self.frame, x, weight=1) for y in range(7): Grid.rowconfigure(self.frame, y, weight=1) self.frame.pack(anchor=N, fill=BOTH, expand=True, side=LEFT)
def __init__(self, master): """initialize GUI""" self.root = master self.on = True self.connection = None Tk().withdraw() self.basicframe = Frame(self.root) self.basicframe.grid() self.basicframe.configure(bg=bgcolor) self.fr = Frame(self.basicframe) self.fr.grid(row=0, column=0, sticky='new') # , sticky='W') self.fr.configure(bg=bgcolor) Grid.columnconfigure(self.root, 0, weight=1) self.port = None self.baud = None # self.inputTypes = ['ascii', 'bin', 'hex', 'mix'] self.inputType = StringVar() self.inputType.set('ascii') self.input = 'ascii' self.labelPort = Label(self.fr, width=10, text='PORT', justify='left', anchor='w', bg=bgcolor, fg=fgcolor, font=("Calibri", 12)) self.entryPort = Entry(self.fr, width=20, bd=3, justify='left', bg=inputbox, fg=fgcolor) self.labelBaud = Label(self.fr, text='BAUD', justify='left', anchor='w', bg=bgcolor, fg=fgcolor, font=("Calibri", 12)) self.entryBaud = Entry(self.fr, width=20, bd=3, justify='right', bg=inputbox, fg=fgcolor) self.labelType = Label(self.fr, text='TYPE', justify='left', anchor='w', bg=bgcolor, fg=fgcolor, font=("Calibri", 12)) self.radioType1 = Radiobutton(self.fr, text='ascii', variable=self.inputType, value='ascii', indicatoron=0) self.radioType2 = Radiobutton(self.fr, text='bin', variable=self.inputType, value='bin', width=20, indicatoron=0) self.radioType3 = Radiobutton(self.fr, text='hex', variable=self.inputType, value='hex', indicatoron=0) self.radioType4 = Radiobutton(self.fr, text='mix', variable=self.inputType, value='mix', width=20, indicatoron=0) self.labelInput = Label(self.fr, text='INPUT', justify='left', anchor='w', bg=bgcolor, fg=fgcolor, font=("Calibri", 12)) self.entryInput = Entry(self.fr, width=20, bd=3, justify='left', bg=inputbox, fg=fgcolor) self.buttonSend = Button(self.fr, text='SEND', justify='center', bg=buttoncolor, command=self.send) self.buttonRead = Button(self.fr, text='READ', justify='center', bg=buttoncolor, command=self.read) self.buttonExit = Button(self.fr, text='EXIT', justify='center', bg='red', fg='white', command=self.exit) self.response = StringVar() self.response.set('') self.responseBar = Label(self.fr, textvariable=self.response, justify='left', anchor='w', bg=bgcolor, fg=fgcolor, font=("Calibri", 12)) self.status = StringVar() self.statusBar = Label(self.fr, textvariable=self.status, justify='left', anchor='nw', bg=bgcolor, fg=fgcolor, font=("Calibri", 10)) self.status.set('Initialized')
def pie_base() -> 'html': df = pd.read_csv('data3.csv', encoding='utf8') bar = ( Bar() .add_xaxis(['不限', '3-5年', '1-3年', '5-10年', '无经验', '一年以下', '10年以上']) .add_yaxis("职位数量", [6183, 5164, 4842, 1516, 366, 111, 34]) .set_global_opts(title_opts=opts.TitleOpts(title="工作经验-职位分布数量")) ) line = ( Line() .add_xaxis(['本科', '大专', '不限', '硕士', '博士', '中专']) .add_yaxis("职位数量", [9954, 3704, 3205, 1137, 88, 31]) .set_global_opts( title_opts=opts.TitleOpts(title="最低要求学历-职位分布数量", pos_top="50%"), legend_opts=opts.LegendOpts(pos_top="50%"), ) ) grid = ( Grid() .add(bar, grid_opts=opts.GridOpts(pos_bottom="60%", pos_right="0", height="30%")) .add(line, grid_opts=opts.GridOpts(pos_top="60%", pos_right="0", height="30%")) ) bar,line,grid.render("./templates/pie_base.html") with open("./templates/pie_base.html", encoding="utf8", mode="r") as f: pie_base = "".join(f.readlines()) return render_template('python_pie_base.html', the_pie_base=pie_base, )
def __init__(self, **kwargs): super().__init__(**kwargs) self._isReady = True Grid.columnconfigure(self, 1, weight=1) self.button = Button(self, text='Help', command=openMiscHelp, width=10) self.button.grid(row=0, column=1, padx=5, pady=5, sticky=E) self._kwargs = Entry(self, width=65) self._kwargs.delete(0, END) self._kwargs.insert(0, '\'sep\' : \',\', \'readTiffTags\' : False') self._kwargs.grid(row=0, column=0, padx=5, pady=5, sticky=W)
def __init__(self, update_slider_range: Callable[[Event], None], draw_field: Callable[[Event], None]) -> None: # programs can only have one window, but can # create multiple "Toplevel"s (effectively new windows) self.window = Toplevel() self.window.title('HexSweeper - Choose Difficulty') self.window.geometry('400x473') self.window.bind('<Configure>', draw_field) # these statements allow the hexgrid (in col 1, row 3) # to stretch as the window is resized # stretch the second column horizontally: Grid.columnconfigure(self.window, 1, weight=1) # stretch the fourth row vertically: Grid.rowconfigure(self.window, 3, weight=1) Label(self.window, text='Board Size:').grid(row=0, column=0, sticky=W) # TkInter "Scale" objects are sliders # Default slider resolution/accuracy is 1 self.game_size_slider = Scale( self.window, # from_ because from is a Python keyword from_=2, to=15, orient=HORIZONTAL, command=update_slider_range) self.game_size_slider.grid(row=0, column=1, sticky=E + W) Label(self.window, text='Number of mines:') \ .grid(row=1, column=0, sticky=W) self.mine_count_slider = Scale(self.window, from_=1, to=315, orient=HORIZONTAL, command=draw_field) self.mine_count_slider.grid(row=1, column=1, sticky=E + W) self.canvas = Canvas(self.window, bg='white') self.canvas.grid( row=3, column=0, # span columns 0 and 1 columnspan=2, # resize with the window sticky=E + N + W + S)
def __init__(self, transcription_tab, main_dir, root): self.root = root self.main_dir = main_dir self.reg_font = ('Times', '12') self.tx_frame = LabelFrame(transcription_tab, text='Transcription', font=self.reg_font) self.tx_frame.pack(fill=BOTH, expand=1) Grid.rowconfigure(self.tx_frame, 0, weight=1) Grid.rowconfigure(self.tx_frame, 1, weight=1) Grid.columnconfigure(self.tx_frame, 0, weight=1) Grid.columnconfigure(self.tx_frame, 1, weight=1) self.launch_ote_button = Button(self.tx_frame, text='Launch OTE', font=self.reg_font, height=2, width=20, command=self.launch_ote) self.launch_ote_button.grid(row=0, column=0, padx=50, pady=20) self.save_html_button = Button(self.tx_frame, text='Save HTML', font=self.reg_font, height=2, width=20, command=self.save_html) self.save_html_button.grid(row=1, column=0, padx=50, pady=20) self.combine_html_button = Button(self.tx_frame, text='Combine HTML', font=self.reg_font, height=2, width=20, command=self.combine_html) self.combine_html_button.grid(row=0, column=1, padx=50, pady=20) self.xml_to_txt_button = Button(self.tx_frame, text='XML to TXT', font=self.reg_font, height=2, width=20, command=self.xml_to_txt) self.xml_to_txt_button.grid(row=1, column=1, padx=50, pady=20) self.text_box_frame = LabelFrame(transcription_tab, text='text box', font=self.reg_font) self.text_box_frame.pack(side=BOTTOM, fill=BOTH, expand=1) self.text_box = Text(self.text_box_frame, relief="sunken", bd=2, height=3) self.text_box.pack(fill=BOTH, expand=1)
def __init__(self, **kwargs): super().__init__(**kwargs) self._isReady = False self.filename = None Grid.columnconfigure(self, 1, weight = 1) self.button = Button(self, text="Browse", command=self.loadFile, width=10) self.button.grid(row = 0, column=1, padx = 5, pady = 5, sticky = E) self.entry = Entry(self, width = 65) self.entry.delete(0, END) self.entry.insert(0, 'Enter a path to a new datastore file...') self.entry.grid(row = 0, column = 0, padx = 5, pady = 5, sticky = W) self.entry.configure(state = 'readonly')
def __init__(self, **kwargs): super().__init__(**kwargs) self._isReady = True Grid.columnconfigure(self, 1, weight = 1) self.button = Button(self, text='Help', command=openMiscHelp, width=10) self.button.grid(row = 0, column=1, padx = 5, pady = 5, sticky = E) self._kwargs = Entry(self, width = 65) self._kwargs.delete(0, END) self._kwargs.insert(0, '\'sep\' : \',\', \'readTiffTags\' : False') self._kwargs.grid(row = 0, column = 0, padx = 5, pady = 5, sticky = W)
def toggleIntroText(self): if self.openFiles == 0: if hasattr(self, 'introText'): self.introText.destroy() Grid.rowconfigure(self.bodyFrame, 2, weight=1) self.introText = Label(self.bodyFrame, text='') self.introText.grid(sticky=W + E + S + N) self.introText['text'] = 'Add banking files via the ' \ '\'Add File\' Button\nand import ' \ 'them via the upcoming Dialoge.\n' \ 'Importing the files is automated ' \ 'using rules,\n which can be added ' \ 'via the menu (Edit->Rules) or while' \ ' importing.\n Unknown entries not ' \ 'matching any rule have to be edited' \ ' by hand.' else: self.introText.destroy() Grid.rowconfigure(self.bodyFrame, 2, weight=0)
def __init__(self, **kwargs): super().__init__(**kwargs) self._isReady = False self.searchPath = None Grid.columnconfigure(self, 1, weight = 1) self.button = Button(self, text="Browse", command=self.loadFile, width=10) self.button.grid(row=0, column=1, padx = 5, pady = 5, sticky = E) self.entry = Entry(self, width = 65) self.entry.delete(0, END) self.entry.insert( 0, 'Enter the directory containing the input files...') self.entry.grid(row = 0, column = 0, padx = 5, pady = 5, sticky = W) self.entry.configure(state = 'readonly')
def showup(self): self.psr = Processor() self.root = Tk() self.root.title("MOPS資訊觀測站") frame = Frame(self.root) frame.grid(row=0, column=0, sticky="news") self.stateV = StringVar() self.stateV.set("日期格式:yyyymmdd") self.statebarL = Label(frame, textvariable=self.stateV) sdateL = Label(frame, text="開始日期") edateL = Label(frame, text="迄止日期") self.sdateE = Entry(frame) self.edateE = Entry(frame) self.goBtn = Button(frame, text="確定", command=self.runProcess) self.statebarL.grid(row=0, column=0, rowspan=1, columnspan=3, sticky="news") sdateL.grid(row=1, column=0, rowspan=1, columnspan=1, sticky="news") edateL.grid(row=2, column=0, rowspan=1, columnspan=1, sticky="news") self.sdateE.grid(row=1, column=1, rowspan=1, columnspan=1, sticky="news") self.edateE.grid(row=2, column=1, rowspan=1, columnspan=1, sticky="news") self.goBtn.grid(row=1, column=2, rowspan=2, columnspan=1, sticky="news") Grid.grid_rowconfigure(self.root, 0, weight=1) Grid.grid_columnconfigure(self.root, 0, weight=1) self.root.mainloop()
def __init__(self, root): top = Toplevel(master = root) top.title('Create a new HDF Datastore') frames = {'SelectFilename' : 0, 'SelectDatasetTypes' : 1, 'SelectSearchPath' : 2, 'SelectParser' : 3, 'Options' : 4, 'BuildButton' : 5} Grid.rowconfigure(top, frames['SelectDatasetTypes'], weight = 1) Grid.rowconfigure(top, frames['BuildButton'], weight = 0) Grid.columnconfigure(top, 0, weight=1) # Select filename and path f = self.Frame_SelectFilename( master = top, padx = 5, pady = 5, text = 'Path and filename for the new datastore') f.grid(row = frames['SelectFilename'], sticky = E+W) # Select dataset types t = self.Frame_SelectDatasetTypes( master = top, padx = 5, pady = 5, text = 'Select dataset types and configure the file reader') t.grid(row = frames['SelectDatasetTypes'], sticky = N+S+E+W) # Select search path s = self.Frame_SelectSearchPath( master = top, padx = 5, pady = 5, text = 'Directory containing input data files') s.grid(row = frames['SelectSearchPath'], sticky = E+W) # Select parser p = self.Frame_SelectParser( master = top, padx = 5, pady = 5, text = 'Select and configure the filename parser') p.grid(row = frames['SelectParser'], sticky = E+W) # Optional arguments for readingFromFiles o = self.Frame_SelectOptions( master = top, padx = 5, pady = 5, text = 'Miscellaneous build options') o.grid(row = frames['Options'], sticky = E+W) frameParams = (f, t, s, p, o) build = Button( master = top, text = 'Build', command=lambda: self._buildDatabase(self, top, frameParams)) build.grid(row = frames['BuildButton']) # Make this window modal top.transient(root) top.grab_set() root.wait_window(top)
def mainDialog(self): self.basicframe = Frame(self.root) self.basicframe.grid() self.basicframe.configure(bg=bgcolor) self.fr = Frame(self.basicframe) self.fr.grid(row=0, column=0, sticky='new') # , sticky='W') self.fr.configure(bg=bgcolor) # Grid.rowconfigure(root, 0, weight=1) Grid.columnconfigure(root, 0, weight=1) self.emptyRow(0) Label(self.fr, textvariable=self.labelTop, justify='center', bg=bgcolor, font=("Calibri", 24) ).grid(row=1, column=0, columnspan=3, sticky='we') self.emptyRow(2) Label(self.fr, text='STATUS:', justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 12) ).grid(row=3, column=0, sticky='we', padx=(5, 0)) self.statusLine = Label(self.fr, textvariable=self.statusString, justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 14, "bold") ).grid(row=3, column=1, columnspan=2, sticky='we') self.emptyRow(4) self.butStartStop = Button(self.fr, textvariable=self.label10, command=self.startStop, bg=startstopbg[self.active], fg=startstopfg[self.active], font=("Calibri", 16, "bold"), width=10) self.butStartStop.grid(row=5, column=1, sticky='nsew') # AUTO / MANUAL self.my_var.set(1) self.butManual = Radiobutton(self.fr, text="MANUAL", variable=self.auto, value=0, width=15, justify='center', # bg=buttoncolor2, bg="moccasin", indicatoron=0) # self.exit_root) self.butManual.grid(row=5, column=0, sticky='ew', padx=(0, 10)) # self.butManual.configure(state='selected') self.butAuto = Radiobutton(self.fr, text="AUTO", variable=self.auto, value=1, width=15, justify='center', # bg=buttoncolor2, bg="moccasin", indicatoron=0) # self.exit_root) self.butAuto.grid(row=5, column=2, sticky='ew', padx=(10, 0)) self.emptyRow(6) self.emptyRow(7) # put Labels here Label(self.fr, textvariable=self.label31, justify='center', bg=bgcolor, fg=statuscolor, font=("Calibri", 10) ).grid(row=8, column=0, sticky='we') Label(self.fr, textvariable=self.label32, justify='center', bg=bgcolor, fg=statuscolor, font=("Calibri", 10) ).grid(row=8, column=1, sticky='we') Label(self.fr, textvariable=self.label33, justify='center', bg=bgcolor, fg=statuscolor, font=("Calibri", 10) ).grid(row=8, column=2, sticky='we') # input boxes: step start stop (mm) self.lowEntry = Entry(self.fr, width=20, bd=3, justify='right', bg=inputbox, fg=statuscolor) self.lowEntry.grid(row=9, column=0, sticky='we') # , columnspan=2) # SET DEFAULT LOW # self.lowEntry.delete(0,END) # self.lowEntry.insert(0, MINPOS) self.hiEntry = Entry(self.fr, width=20, bd=3, justify='right', bg=inputbox, fg=statuscolor) self.hiEntry.grid(row=9, column=1, sticky='we') # , columnspan=2) # SET DEFAULT HIGH # self.hiEntry.delete(0,END) # self.hiEntry.insert(0, MAXPOS) self.stepEntry = Entry(self.fr, width=20, bd=3, justify='right', bg=inputbox, fg=statuscolor) self.stepEntry.grid(row=9, column=2, sticky='we') # , columnspan=2) # put buttons for GOTO and MOVE self.butGotoLow = Button(self.fr, text="Go To Low", justify='center', bg=buttoncolor, command=self.gotoLow) self.butGotoLow.grid(row=10, column=0, sticky='we') self.butGotoHi = Button(self.fr, text="Go To High", justify='center', bg=buttoncolor, command=self.gotoHi) self.butGotoHi.grid(row=10, column=1, sticky='we') self.butMoveStep = Button(self.fr, text="Move a Step", justify='center', bg=buttoncolor, command=self.moveStep) self.butMoveStep.grid(row=10, column=2, sticky='we') self.emptyRow(11) Label(self.fr, text='EXTERNAL SENSORS', justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 12) ).grid(row=12, column=0, columnspan=3, sticky='we', padx=(5, 0)) # function buttons # RIadok 12: Externals butIFM = Button(self.fr, text="Read IFM", width=15, justify='center', bg=buttoncolor, command=self.getIfm) # self.exit_root) butIFM.grid(row=13, column=0, sticky='we') self.labIfmStatus = Label(self.fr, textvariable=self.ifmStatus, justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 12)) self.labIfmStatus.grid(row=13, column=1, columnspan=2, sticky='we', padx=(15, 0)) self.labIfmStatus.bind('<Button-1>', self.resetIfmStatus) butLVL = Button(self.fr, text="Read level", width=15, justify='center', bg=buttoncolor, command=self.getLevel) # self.exit_root) butLVL.grid(row=14, column=0, sticky='we') self.labLvlStatus = Label(self.fr, textvariable=self.lvlStatus, justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 12)) self.labLvlStatus.grid(row=14, column=1, columnspan=2, sticky='we', padx=(15, 0)) self.labLvlStatus.bind('<Button-1>', self.resetLvlStatus) self.emptyRow(15) Label(self.fr, text='OBSERVER:', anchor='w', justify='left', bg=bgcolor, fg=statuscolor, font=("Calibri", 12) ).grid(row=16, column=0, sticky='we', padx=(5, 0)) self.entryObserver = Entry(self.fr, textvariable=self.observer, bg=inputbox, fg=statuscolor, font=("Calibri", 12), justify='left') self.entryObserver.grid(row=16, column=1, columnspan=2, sticky='we') # row 18> empty (or test connection) self.emptyRow(18) self.timeLabel = Label(self.fr, textvariable=self.timestring, anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 9)) self.timeLabel.grid(row=19, column=0) self.connLabel = Label(self.fr, textvariable=self.connstring, anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 9)) self.connLabel.grid(row=19, column=1) butexit = Button(self.fr, text="EXIT", width=15, justify='center', bg="black", fg="yellow", command=self.close, font=("Calibri", 14, "bold")) butexit.grid(row=19, column=2)
def mainDialog(self): self.basicframe = Frame(self.root) self.basicframe.grid() self.basicframe.configure(bg=bgcolor) self.fr = Frame(self.basicframe) self.fr.grid(row=0, column=0, sticky='new') # , sticky='W') self.fr.configure(bg=bgcolor) # Grid.rowconfigure(root, 0, weight=1) Grid.columnconfigure(root, 0, weight=1) self.emptyRow(0) Label(self.fr, textvariable=self.labelTop, justify='center', bg=bgcolor, font=("Calibri", 24) ).grid(row=1, column=0, columnspan=3, sticky='we') self.emptyRow(2) Label(self.fr, text='STATUS:', justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 12) ).grid(row=3, column=0, sticky='we', padx=(5, 0)) self.statusLine = Label(self.fr, textvariable=self.statusString, justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 14, "bold") ).grid(row=3, column=1, columnspan=2, sticky='we') self.emptyRow(4) # AUTO / MANUAL self.my_var.set(1) self.buttonManual = Radiobutton(self.fr, text="MANUAL", variable=self.auto, value=0, width=15, justify='center', # bg=buttoncolor2, bg="moccasin", indicatoron=0) # self.exit_root) self.buttonManual.grid(row=5, column=0, sticky='ew', padx=(0, 10)) # self.buttonManual.configure(state='selected') self.buttonAuto = Radiobutton(self.fr, text="AUTO", variable=self.auto, value=1, width=15, justify='center', # bg=buttoncolor2, bg="moccasin", indicatoron=0) # self.exit_root) self.buttonAuto.grid(row=5, column=2, sticky='ew', padx=(10, 0)) self.emptyRow(6) #should be disabled if initialized already self.buttonInitialize = Button(self.fr, text='Initialize', justify='center', bg=buttoncolor, command=self.initialize) self.buttonInitialize.grid(row=7, column=0, sticky='nsew') self.buttonStartStop = Button(self.fr, textvariable=self.label11, command=self.startStop, bg=startstopbg[self.active], fg=startstopfg[self.active], font=("Calibri", 16, "bold"), width=10) self.buttonStartStop.grid(row=7, column=1, sticky='nsew') self.buttonPause = Button(self.fr, textvariable=self.label12, justify='center', bg=buttoncolor, state={0: 'disabled', 1: 'enabled'}[self.auto], command=self.pause) self.buttonPause.grid(row=7, column=2, sticky='nsew') self.emptyRow(8) # put Labels here Label(self.fr, textvariable=self.label31, justify='center', bg=bgcolor, fg=statuscolor, font=("Calibri", 10) ).grid(row=8, column=0, sticky='we') Label(self.fr, textvariable=self.label32, justify='center', bg=bgcolor, fg=statuscolor, font=("Calibri", 10) ).grid(row=8, column=1, sticky='we') Label(self.fr, textvariable=self.label33, justify='center', bg=bgcolor, fg=statuscolor, font=("Calibri", 10) ).grid(row=8, column=2, sticky='we') # input boxes: step start stop (mm) self.lowEntry = Entry(self.fr, width=20, bd=3, justify='right', bg=inputbox, fg=statuscolor) self.lowEntry.grid(row=9, column=0, sticky='we') # , columnspan=2) # SET DEFAULT LOW # self.lowEntry.delete(0,END) # self.lowEntry.insert(0, MINPOS) self.hiEntry = Entry(self.fr, width=20, bd=3, justify='right', bg=inputbox, fg=statuscolor) self.hiEntry.grid(row=9, column=1, sticky='we') # , columnspan=2) # SET DEFAULT HIGH # self.hiEntry.delete(0,END) # self.hiEntry.insert(0, MAXPOS) self.stepEntry = Entry(self.fr, width=20, bd=3, justify='right', bg=inputbox, fg=statuscolor) self.stepEntry.grid(row=9, column=2, sticky='we') # , columnspan=2) # put buttons for GOTO and MOVE self.butGotoLow = Button(self.fr, text="Go To Low", justify='center', bg=buttoncolor, command=self.gotoLow) self.butGotoLow.grid(row=10, column=0, sticky='we') self.butGotoHi = Button(self.fr, text="Go To High", justify='center', bg=buttoncolor, command=self.gotoHi) self.butGotoHi.grid(row=10, column=1, sticky='we') self.butMoveStep = Button(self.fr, text="Move a Step", justify='center', bg=buttoncolor, command=self.moveStep) self.butMoveStep.grid(row=10, column=2, sticky='we') self.emptyRow(11) Label(self.fr, text='EXTERNAL SENSORS', justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 12) ).grid(row=12, column=0, columnspan=3, sticky='we', padx=(5, 0)) # function buttons # RIadok 13-16: Externals # Interferometer buttonIfm = Button(self.fr, text="Read IFM", width=15, justify='center', bg=buttoncolor, command=self.getIfm) # self.exit_root) buttonIfm.grid(row=13, column=0, sticky='we') self.labelIfmStatus = Label(self.fr, textvariable=self.ifmStatus, justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 12)) self.labelIfmStatus.grid(row=13, column=1, columnspan=2, sticky='we', padx=(15, 0)) self.labelIfmStatus.bind('<Button-1>', self.resetIfmStatus) # Digital level (Leica /Trimble) buttonLevel = Button(self.fr, text="Read Level", width=15, justify='center', bg=buttoncolor, command=self.getLevel) # self.exit_root) buttonLevel.grid(row=14, column=0, sticky='we') self.labelLevelStatus = Label(self.fr, textvariable=self.levelStatus, justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 12)) self.labelLevelStatus.grid(row=14, column=1, columnspan=2, sticky='we', padx=(15, 0)) self.labelLevelStatus.bind('<Button-1>', self.resetLevelStatus) # Nivel - inclinometer buttonNivel = Button(self.fr, text="Read Nivel", width=15, justify='center', bg=buttoncolor, command=self.getNivel) # self.exit_root) buttonNivel.grid(row=15, column=0, sticky='we') self.labelNivelStatus = Label(self.fr, textvariable=self.nivelStatus, justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 12)) self.labelNivelStatus.grid(row=15, column=1, columnspan=2, sticky='we', padx=(15, 0)) self.labelNivelStatus.bind('<Button-1>', self.resetNivelStatus) # Thermometer line buttonThermo = Button(self.fr, text="Read Thermo", width=15, justify='center', bg=buttoncolor, command=self.getThermo) # self.exit_root) buttonThermo.grid(row=16, column=0, sticky='we') self.labelThermoStatus = Label(self.fr, textvariable=self.thermoStatus, justify='left', anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 12)) self.labelThermoStatus.grid(row=16, column=1, columnspan=2, sticky='we', padx=(15, 0)) self.labelThermoStatus.bind('<Button-1>', self.resetThermoStatus) self.emptyRow(17) Label(self.fr, text='OBSERVER:', anchor='w', justify='left', bg=bgcolor, fg=statuscolor, font=("Calibri", 12) ).grid(row=19, column=0, sticky='we', padx=(5, 0)) self.entryObserver = Entry(self.fr, textvariable=self.observer, bg=inputbox, fg=statuscolor, font=("Calibri", 12), justify='left') self.entryObserver.grid(row=19, column=1, columnspan=2, sticky='we') # row 18> empty (or test connection) self.emptyRow(20) if ADMIN_MODE: # port, message, checksum_type?, resulting checksum?, submit, response self.portEntry = Entry(self.fr, width=20, bd=3, justify='left', bg=inputbox, fg=statuscolor) self.portEntry.grid(row=21, column=0, sticky='we') Label(self.fr, text='PORT', anchor='w', justify='left', bg=bgcolor, fg=statuscolor, font=("Calibri", 12) ).grid(row=22, column=0, sticky='we', padx=(5, 0)) self.messageEntry = Entry(self.fr, width=20, bd=3, justify='left', bg=inputbox, fg=statuscolor) self.messageEntry.grid(row=21, column=1, sticky='we') Label(self.fr, text='MESSAGE', anchor='w', justify='left', bg=bgcolor, fg=statuscolor, font=("Calibri", 12) ).grid(row=22, column=1, sticky='we', padx=(5, 0)) self.portChecksumType = Entry(self.fr, width=20, bd=3, justify='left', bg=inputbox, fg=statuscolor) self.portChecksumType.grid(row=21, column=2, sticky = 'we') Label(self.fr, text='CHKSUM TYPE', anchor='w', justify='left', bg=bgcolor, fg=statuscolor, font=("Calibri", 12) ).grid(row=22, column=2, sticky='we', padx=(5, 0)) self.chksumLabel = Label(self.fr, textvariable=self.chksumText, anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 9)) self.chksumLabel.grid(row=23, column=2) buttonSubmit = Button(self.fr, text="SUBMIT", width=15, justify='center', bg="black", fg="yellow", command=self.submit, font=("Calibri", 14, "bold")) buttonSubmit.grid(row=23, column=0) self.responseLabel = Label(self.fr, textvariable=self.responseText, anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 9)) self.responseLabel.grid(row=23, column=1) self.emptyRow(24) lastLine = 21 if not ADMIN_MODE else 25 self.timeLabel = Label(self.fr, textvariable=self.timestring, anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 9)) self.timeLabel.grid(row=lastLine, column=0) self.connLabel = Label(self.fr, textvariable=self.connstring, anchor='w', bg=bgcolor, fg=statuscolor, font=("Calibri", 9)) self.connLabel.grid(row=lastLine, column=1) butexit = Button(self.fr, text="EXIT", width=15, justify='center', bg="black", fg="yellow", command=self.close, font=("Calibri", 14, "bold")) butexit.grid(row=lastLine, column=2)