Label(calibration, text="Place the camera on a surface where the camera points to your face").pack() Label(calibration, text="Press Start to begin calibration").pack() Label(calibration, text="When a rectangle appears around your face, press 'q' to end calibration").pack() Button(calibration, text="Start", command=screenCal, height=3, width=10).place(relx=0.5, rely=0.5, anchor=CENTER) Button(calibration, text="Next", command=activePage,height=2, width=10).place(relx=0.9, rely=0.9, anchor=SE) # Window settings root = Tk() root.title('Impunity') root.geometry('640x360') try: root.iconbitmap(logo_vs) except: print("Wrong Directory!") root.iconbitmap(logo_term) else: root.iconbitmap(logo_vs) # Font settings hdFont = font.Font(family='Helvetica', size=30, weight='bold') pFont = font.Font(family='Helvetica', size=10) # Labels and Buttons Label(root, text='Impunity', font=hdFont).place(relx=0.5, rely=0.45, anchor=S) Label(root, text='Making your trip safer', font = pFont).place(relx=0.5, rely=0.5, anchor=CENTER) btnNext = Button(root, text='Next', height=3, width=10, command = calPage) btnNext.place(relx=0.5, rely=0.56, anchor=N) # Similar to a Game Loop to keep the application running root.mainloop()
print("Unknown system!") main_win.title(f"EPCboot {Version.full}") FIRMWARE = "" # string containing firmware # firmware tab: firmware_tab = ttk.Frame(main_win) com_frame = ttk.Labelframe(firmware_tab, text="COM settings") com_label = ttk.Label(com_frame, text="COM port:") URL = tk.StringVar() # URL of port combox = ttk.Combobox(com_frame, postcommand=_update_combox, width=15, textvariable=URL) combox.bind("<<ComboboxSelected>>", com_chosen) com_hint = ttk.Label(com_frame, font=("Calibri Italic", 10)) underlined_font = font.Font(com_hint, com_hint.cget("font")) underlined_font.configure(underline=True) com_hint.configure(font=underlined_font) tip_com_hin = ToolTip(com_hint) if sys.platform.startswith("win"): com_hint.config(text="Input format", foreground="grey") tip_com_hin.set_text(r"com:\\.\COMx") elif sys.platform.startswith("linux"): com_hint.config(text="Input format", foreground="grey") tip_com_hin.set_text("com:///dev/ttyUSBx\ncom:///dev/ttyACMx\n" "com:///dev/ttySx") firmware_frame = ttk.Labelframe(firmware_tab, text="Firmware update") firmware_label = ttk.Label(firmware_frame, text="Firmware:") FIRM_PATH = tk.StringVar() # path to firmware firmware_entry = ttk.Entry(firmware_frame, textvariable=FIRM_PATH, width=17) firmware_browse_button = ttk.Button(firmware_frame,
def show_pic(path, size=30, family="times", weight=tkfont.NORMAL, *, name=None, picture_width=None, parent=None): if parent == None: xroot = tk.Tk() else: xroot = parent H = xroot.winfo_screenheight() W = xroot.winfo_screenwidth() VH = xroot.winfo_vrootheight() RH = xroot.winfo_reqheight() dW = 16 dH = 40 #print(H, VH, RH) #H = 721 #print(xroot.keys()) xroot.config() font = tkfont.Font(family=family, name=name, size=size, weight=weight) if picture_width == None: s = tk.Scrollbar() #print(s.configure()) dW = int(s.cget('width')) #print(dW) picture_width = W - dW elif not isinstance(picture_width, int) or picture_width <= 0: raise ValueError( 'not isinstance(picture_width, int) or picture_width <= 0') app = App(path, picture_width, font, xroot) assert app.winfo_toplevel() is xroot #xroot.title(path) #xroot.maxsize(1366, 768) #print('wm_geometry', xroot.wm_geometry()) xroot.wm_geometry('{}x{}+0+0'.format(W, H - dH)) #xroot.wm_positionfrom('user') #xroot.wm_sizefrom('user') #xroot.wm_withdraw() # The following three commands are needed so the window pops # up on top on Windows... xroot.iconify() xroot.update() xroot.deiconify() xroot.focus() try: pass xroot.wm_state('zoomed') except: pass #xroot.wm_focusmodel('passive') xroot.mainloop()
root.after(1000, show_time) # Use tkinter lib for showing the clock root = Tk() root.attributes("-fullscreen", True) root.configure(background='black') root.bind("x", quit) root.after(0, show_time) endTime1 = datetime.datetime(2018, 11, 17, 18, 30, 0) endTime2 = datetime.datetime(2018, 11, 17, 18, 40, 0) endTime3 = datetime.datetime(2018, 11, 17, 18, 50, 0) endTime4 = datetime.datetime(2018, 11, 17, 19, 0, 0) timerLength = datetime.timedelta(minutes=5) fix = datetime.timedelta(seconds=1) startTime1 = endTime1 - timerLength startTime2 = endTime2 - timerLength startTime3 = endTime3 - timerLength startTime4 = endTime4 - timerLength camera = PiCamera() camera.start_preview() fnt = font.Font(family='Helvetica', size=200, weight='bold') txt = StringVar() lbl = ttk.Label(root, textvariable=txt, font=fnt, foreground="white", background="black") lbl.place(relx=0.5, rely=0.5, anchor=CENTER) root.mainloop()
def __init__(self, parent, controller, clicked): tk.Frame.__init__(self, parent) self.running = 1 self.queue = controller.queue self.flagQueue = Queue.Queue() self.controller = controller self.clicked = clicked style = Style() #style.configure("BW.TLabel", font = ('Helvetica','10'),foreground="#64B23B") #style.configure("BW.TButton", font = ('Helvetica','10'), foreground="#64B23B", background="#FFFFFF") style.configure("BW.TEntry", background="gray90") #imgFile = '\\\\'.join(os.path.join(current_folder,"jnj.gif").split('\\')) img = tk.PhotoImage(data=Images.jnjGIF) self.logo = Label(self, image=img) self.logo.image = img self.message = Label(self, text="Please enter your login information:") self.message.config(font=('Helvetica', '12'), foreground="#638213", background="#FFFFFF") self.loginStatusMsg = Label(self, text='', font=('Helvetica', '10'), foreground="black", background="#FFFFFF") self.authorName = Label( self, text=u'\u00a9' + " Designed & Developed by Prashanth Kumar & Andrew Jesiah") self.authorName.config(font=('Montserrat', '8'), foreground="#112D25", background="#FFFFFF") large_font = ('Verdana', 17) self.UserEntry = Entry(self, style="BW.TEntry", font=large_font, foreground='grey') self.UserEntry.insert(0, 'Employee ID') self.UserEntry.bind('<FocusIn>', self.on_Userentry_click) self.UserEntry.bind('<FocusOut>', self.on_Userfocusout) self.UserEntry.bind( '<Return>', lambda x: self.clicked(self.UserEntry.get(), self.PassEntry.get())) self.PassEntry = Entry(self, style="BW.TEntry", font=large_font, foreground='grey') self.PassEntry.insert(0, 'Password') self.PassEntry.bind('<FocusIn>', self.on_Passentry_click) self.PassEntry.bind('<FocusOut>', self.on_Passfocusout) self.PassEntry.bind( '<Return>', lambda x: self.clicked(self.UserEntry.get(), self.PassEntry.get())) ''' self.signal = tk.Canvas(self,width=15, height=15) self.signal.place(x='470', y='220') self.catsWebLabel = Label(self, text='CATSWeb',style='BW.TLabel') self.catsWebLabel.place(x='390', y='220') ''' helv36 = font.Font(family='Helvetica', size=11) self.btn = tk.Button(self, text="Login", command=lambda: self.clicked( self.UserEntry.get(), self.PassEntry.get())) self.btn.config(relief='flat', bg='#737370', fg="#FFFFFF", height=2, width=33) self.btn.bind( '<Return>', lambda x: self.clicked(self.UserEntry.get(), self.PassEntry.get())) self.btn['font'] = helv36 self.internet = Label(self, text="Checking...") self.internet.config(font=('Helvetica', '11'), foreground="black", background="#FFFFFF") self.logo.place(x='200', y='50', anchor='center') self.message.place(x='200', y='115', anchor="center") self.loginStatusMsg.place(x='200', y='170', anchor="center") self.UserEntry.place(x='47', y='200') self.PassEntry.place(x='47', y='260') self.btn.place(x='47', y='325') self.authorName.place(x='87', y='442')
from tkinter import * from tkinter import ttk from tkinter import font root = Tk() root.title("Briefing Manager") canvas = Canvas(root, width=1050, height=580) canvas.grid() BodoniMT250 = font.Font(family='Bodoni MT', name='BodoniMT250', size=250) BodoniMT50 = font.Font(family='Bodoni MT', name='BodoniMT50', size=50) BodoniMT75 = font.Font(family='Bodoni MT', name='BodoniMT75', size=75) line1 = ttk.Label(canvas, text='Alive', font=BodoniMT250) line2 = ttk.Label(canvas, text='Angel Beats!', font=BodoniMT50) line3 = ttk.Label(canvas, text='EPISODE.07', font=BodoniMT75) canvas.create_window(470, 200, window=line1) canvas.create_window(575, 375, window=line2) canvas.create_window(675, 475, window=line3) root.resizable(False, False) root.mainloop()
def __init__(self, unitList, master, p): self.p = p self.money = p.getMoney() self.root = master self.mainFrame = tk.Frame(self.root) # Laver Done-vinduet, som ikke vises til at starte med (først når man har trykket på done) self.otherWindow = tk.Toplevel(self.root) self.otherWindow.withdraw() self.fontStyle = tkFont.Font(family="Lucida Grande", size=24) # Laver to Frames som styrer hvad der er på højre og venstre side af skærmen. self.leftFrame = tk.Frame(self.root, width=850, height=900) self.leftFrame.grid(row=0, column=1) self.rightFrame = tk.Frame(self.root, width=850, height=900) self.rightFrame.grid(row=0, column=2, sticky="nw") # Laver phImg om til et PhotoImage, så det kan bruges til knapper og labels. self.phImg = ImageTk.PhotoImage(self.img) # Laver alle icons om til PhotImage i den rigtige størrelse. for x in range(4): tempIcon = self.icons[x].resize((150, 150)) self.icons[x] = ImageTk.PhotoImage(tempIcon) # Putter hvert ikon ind på pladserne, an på hvilket ikon der skal være der (valgt ud fra teamRarity) # Det vil sige ikon[0] er på 0's plads, ikon[1] er på 1's og 2's plads. for x in range(len(self.teamIcons)): self.teamIcons[x] = self.icons[self.teamRarity[x]] self.printGrid() self.unitList = unitList.copy() self.tempList = [] # Bruges til at gemme alle de værider der fjernes ved en søgning. self.bSort = BubbleSort() self.SortUnits() self.ShowUnitList() # money_text er en string-variabel, som opdateres hver gang money bliver ændret på. self.money_text = tk.StringVar() self.money_text.set("Money: " + str(self.money)) self.moneyFont = tkFont.Font(family="Lucida Grande", size=32) moneyLabel = tk.Label(self.rightFrame, textvariable=self.money_text, font=self.moneyFont) moneyLabel.grid(row=1, column=0, sticky="nw", padx=20, pady=15) # Knap som kalder funktionen doneBtnCLicked, når man trykker på den. doneBtn = tk.Button(self.rightFrame, text="Done!", command=self.doneBtnClicked, font=self.moneyFont) doneBtn.grid(row=2, column=0, padx=50, pady=100) self.sortFont = tkFont.Font(family="Lucida Grande", size=16) self.sortLabel = tk.Label(self.leftFrame, text="Sort by:", font=self.sortFont) self.sortLabel.grid(row=1, column=1, sticky="news", pady=10) #Laver en Frame hvor alle sorteringselementer bliver lagt ind i. self.sortFrame = tk.Frame(self.leftFrame) self.sortFrame.grid(row=2, column=1, sticky="nw") self.sortBtns = [None] * len(self.sortStr) self.UpdateSortButtons() # Adder søgebaren og en søgeknap (der kalder Search-funktionen når man trykker på den) til sortLabel. self.searchBar = tk.Entry(self.sortFrame) self.searchBar.grid(row=0, column=7, padx=15) self.searchBtn = tk.Button(self.sortFrame, text='Search', command=self.Search) self.searchBtn.grid(row=0, column=8)
def Configuration2(parent, E): # ================================================================= ''' Interactive widget to modify the options of 2D contour plots''' __version__ = "1.0" __author__ = "Quim Ballabrerera" __date__ = "August 2020" font_bold = tkfont.Font(font='TkDefaultFont').copy() font_bold['weight'] = 'bold' frame1 = ttk.Frame(parent, borderwidth=5, padding=5, relief='sunken') ttk.Label(frame1, text='Ellipse of variance', font=font_bold).grid(row=0, column=0, sticky='w') ttk.Label(frame1, text='ALIAS:').grid(row=1, column=0, sticky='w') ttk.Label(frame1, text=E.ALIAS.get(), width=30).grid(row=1, column=1, sticky='w') ttk.Label(frame1, text='SOURCE:').grid(row=2, column=0, sticky='w') ttk.Label(frame1, text=E.SOURCE, width=30).grid(row=2, column=1, sticky='w') ttk.Label(frame1, text='PARENT:').grid(row=3, column=0, sticky='w') ttk.Label(frame1, text=E.PARENT, width=30).grid(row=3, column=1, sticky='w') frame1.grid() frame2 = ttk.Frame(parent, borderwidth=5, padding=5) ttk.Label(frame2, text='Add mean and anomaly directions:').grid(row=0, column=0, columnspan=2, sticky='we') tk.Checkbutton(frame2, variable=E.PLOT.ADD_ROTATION).grid(row=0, column=2, sticky='w') ttk.Label(frame2, text='Size scale:').grid(row=1, column=0, sticky='e') ttk.Entry(frame2, textvariable=E.PLOT.scale, width=10).grid(row=1, column=1, sticky='we') ttk.Label(frame2, text='Line style:').grid(row=2, column=0, sticky='e') ttk.Entry(frame2, textvariable=E.PLOT.LINE_STYLE, width=10).grid(row=2, column=1, sticky='we') ttk.Label(frame2, text='Line width:').grid(row=3, column=0, sticky='e') ttk.Entry(frame2, textvariable=E.PLOT.LINE_WIDTH, width=10).grid(row=3, column=1, sticky='we') ttk.Label(frame2, text='Line color:').grid(row=4, column=0, sticky='e') sclabel = ttk.Style() sclabel.configure("sclabel.TLabel", background=E.PLOT.LINE_COLOR.get(), anchor="center") ecol = ttk.Label(frame2, textvariable=E.PLOT.LINE_COLOR, width=8, style="sclabel.TLabel") # Map Contour Color ecol.grid(row=4, column=1, padx=3, sticky='we') ttk.Button(frame2,text='Select',command=lambda:colsel(E.PLOT.LINE_COLOR, \ sclabel,ecol,"sclabel.TLabel",master=parent)).\ grid(row=4,column=2,padx=3,sticky='ew') ttk.Label(frame2, text='Show center point:').grid(row=5, column=0, columnspan=2, sticky='we') tk.Checkbutton(frame2, variable=E.PLOT.SHOW_CENTER).grid(row=5, column=2, sticky='w') ttk.Label(frame2, text='Show mean direction:').grid(row=6, column=0, columnspan=2, sticky='we') tk.Checkbutton(frame2, variable=E.PLOT.SHOW_MAJOR).grid(row=6, column=2, sticky='w') ttk.Label(frame2, text='Alpha:').grid(row=7, column=0, sticky='e') ttk.Entry(frame2, textvariable=E.PLOT.ALPHA, width=10).grid(row=7, column=1, sticky='we') ttk.Label(frame2, text='Zorder:').grid(row=8, column=0, sticky='e') ttk.Entry(frame2, textvariable=E.PLOT.ZORDER, width=10).grid(row=8, column=1, sticky='we') frame2.grid()
def interfaz(self): self.root = tk.Tk() self.root.config(width=300, height=200) #Disenio de las letras costumFontTitulo = tkFont.Font(family="Bernard MT", size=35, weight=tkFont.BOLD) costumFontSubTit = tkFont.Font(family="Times", size=14) #Espacio para dividir las cosas en el root labelEspacio = tk.Label(self.root).grid(row=2, sticky='nw', column=0) labelEspacioDos = tk.Label(self.root, width=5, height=5).grid(row=3, sticky='nw', column=5) #Titulo en la interfaz labelTitulo = tk.Label(self.root, text="Despachador", font=costumFontTitulo).grid(row=0, sticky='nw', column=0) #Se crea el frame donde se encuentra Quantums y Num de Micros frame_DatosIngreso = tk.Frame(self.root, bg="white") frame_DatosIngreso.grid(row=1, column=0, sticky='nw') frame_DatosIngreso.grid_rowconfigure(0, weight=1) frame_DatosIngreso.grid_columnconfigure(0, weight=1) #Se crea el Canvas de Quantums y Num de Micros canvasDatos = tk.Canvas(frame_DatosIngreso, bg="white") canvasDatos.grid(row=0, column=0, sticky="nw") #Se crea el siguiente frame donde se guardan las Lables frameDatos = tk.Frame(frame_DatosIngreso) canvasDatos.create_window((0, 0), window=frameDatos, anchor='nw') #Se crea las Labels y Caja de taxto de Quantums labelQuantums = tk.Label(canvasDatos, text="Quantums", font=costumFontSubTit).grid(row=0, sticky='nw', column=0) self.entryQuantums = tk.Entry(canvasDatos).grid(row=0, column=1, sticky='nw') #Se crea las Labels y Caja de taxto de Numero de Micros labelMicro = tk.Label(canvasDatos, text="Numero de micros", font=costumFontSubTit).grid(row=1, sticky='nw', column=0) self.entryMicro = tk.Entry(canvasDatos) self.entryMicro.grid(row=1, column=1, sticky='nw') #Se creo el boton de Mostrar tabla #Llama a funcion de aniadirMicro button = ttk.Button(canvasDatos, text="Mostrar Tabla", command=self.prueba) button.grid(row=3, column=0, sticky="nw") #Se crea el primer Frame de la lista de procesos frame_canvas = tk.Frame(self.root, bg="red", highlightbackground="black", highlightthickness=2) frame_canvas.grid(row=3, column=0, sticky='nw') frame_canvas.grid_rowconfigure(0, weight=1) frame_canvas.grid_columnconfigure(0, weight=1) #Se creo el Canvas de la Lista de procesos canvas = tk.Canvas(frame_canvas, bg="gray") canvas.grid(row=1, column=0, sticky="news") #Se crea el Frame que tendra guardado los datos de los Procesos frameProcesos = tk.Frame(frame_canvas, bg="gray", width=frame_canvas.winfo_width()) frameProcesos.grid_columnconfigure(0, weight=1, pad=20) frameProcesos.grid_columnconfigure(1, weight=1, pad=100) frameProcesos.grid_columnconfigure(2, weight=1, pad=100) frameProcesos.grid_columnconfigure(3, weight=1, pad=100) canvas.create_window((0, 0), window=frameProcesos, anchor='ne') #Se creo una ScrollBar para poder mostrar todos los proceso en un espacio compacto vsb = tk.Scrollbar(frame_canvas, orient="vertical", command=canvas.yview) vsb.grid(row=1, column=1, sticky='ns') canvas.configure(yscrollcommand=vsb.set) rows = len(self.listaDeProcesos) columns = 3 #Se crea el Lable que muestra el menu de la tabla menuDeTabla = tk.Label( frame_canvas, text= "Proceso Tiempo de Proceso Tiempo de Entrada Cantidad de Bloque", bg="red") menuDeTabla.grid(row=0, column=0) #Agrega cada proceso al Frame por Nombre, Tamao, Tiempo de Entrada y Bloqueo for i in range(0, rows): procesoNom = tk.Label(frameProcesos, text=self.listaDeProcesos[i], bg="gray", fg="white") procesoNom.grid(row=i, column=0) procesoTamanio = tk.Label(frameProcesos, text=self.tamanioDeProceso[i], bg="gray", fg="white") procesoTamanio.grid(row=i, column=1) procesoTiempo = tk.Label(frameProcesos, text=self.tiempoDeEntrada[i], bg="gray", fg="white") procesoTiempo.grid(row=i, column=2) procesoBloq = tk.Label(frameProcesos, text=self.cantidadDeBloqueo[i], bg="gray", fg="white") procesoBloq.grid(row=i, column=3) frameProcesos.update_idletasks() canvas.config(scrollregion=canvas.bbox("all")) #Entry para numero de micro seleccionado self.labelNumDeMicros = tk.Label(self.root, text="Micros", font=costumFontSubTit).grid( row=1, sticky='nw', column=7) self.entryNumMicro = tk.Entry(self.root) self.entryNumMicro.grid(row=2, column=7, sticky='nw') #Se crea el primer Frame de la lista de Micros self.frame_canvasMicro = tk.Frame(self.root, bg="red", highlightbackground="black", highlightthickness=2) self.frame_canvasMicro.grid(row=3, column=7, sticky='nw') self.frame_canvasMicro.grid_rowconfigure(0, weight=1) self.frame_canvasMicro.grid_columnconfigure(0, weight=1) #Se creo el Canvas de la Lista de Micros self.canvasMicro = tk.Canvas(self.frame_canvasMicro, bg="gray") self.canvasMicro.grid(row=1, column=0, sticky="news") #Se crea el Frame que tendra guardado los datos de los Micros self.frameMicro = tk.Frame(self.frame_canvasMicro, bg="gray", width=self.frame_canvasMicro.winfo_width()) self.frameMicro.grid_columnconfigure(0, weight=1, pad=50) self.frameMicro.grid_columnconfigure(1, weight=1, pad=35) self.frameMicro.grid_columnconfigure(2, weight=1, pad=35) self.frameMicro.grid_columnconfigure(3, weight=1, pad=65) self.frameMicro.grid_columnconfigure(4, weight=1, pad=40) self.frameMicro.grid_columnconfigure(5, weight=1, pad=50) self.frameMicro.grid_columnconfigure(6, weight=1, pad=15) self.frameMicro.grid_columnconfigure(7, weight=1, pad=30) self.canvasMicro.create_window((0, 0), window=self.frameMicro, anchor='nw') #Se creo una ScrollBar para poder mostrar todos los Micros en un espacio compacto vsb = tk.Scrollbar(self.frame_canvasMicro, orient="vertical", command=self.canvasMicro.yview, bg="black") vsb.grid(row=1, column=1, sticky='ns') self.canvasMicro.configure(yscrollcommand=vsb.set) #Se crea el Lable que muestra el menu de la tabla menuDeTablaMicros = tk.Label( self.frame_canvasMicro, text= "Proceso TCC TE TVC TB TT TI TF ", bg="red") menuDeTablaMicros.grid(row=0, column=0) self.frameMicro.update_idletasks() self.canvasMicro.config(scrollregion=self.canvasMicro.bbox("all")) button.pack self.root.mainloop()
def __init__(self): self.argument = GetArgument( ) #Get argument (file or folder name) if program was executed from a context menu self.window = tk.Tk() #Create main window self.settings = Settings_class() #This object holds user settings self.settings.Load( ) #Load settings saved in an external file (Config.ini) atexit.register(self.settings.Save ) #Set settings.Save() to run when program is closed # _____ _ _ _____ # / ____| | | |_ _| # | | __| | | | | | # | | |_ | | | | | | # | |__| | |__| |_| |_ # \_____|\____/|_____| #GUI uses the Tkinter framework. The elements are positioned using pack(), rather than grid(), #as I found it easier for correct alignments as long as inline elements are grouped inside frames ''' ----- Main window ----- ''' self.window.geometry("300x350") self.window.title("Comic Resizer") ''' ----- Source ----- ''' self.frameSource = tk.Frame(self.window) self.frameSource.pack(side=tk.TOP, fill=tk.BOTH, expand=False) self.label = tk.Label(self.frameSource, text="Source") self.label.pack(side=tk.TOP, fill=tk.NONE, expand=True, padx=5, pady=0, anchor='sw') self.pathTextBox = tk.Entry(self.frameSource, width=42) self.pathTextBox.pack(side=tk.LEFT, fill=tk.NONE, expand=False, padx=5, pady=0, anchor='nw') self.pathTextBox.insert(0, self.argument) self.dirDialogButton = tk.Button( self.frameSource, text="...", height=1, command=lambda: OpenFileDialog(self.pathTextBox)) self.dirDialogButton.pack(side=tk.LEFT, fill=tk.NONE, expand=False, padx=5, pady=0) ''' ----- Width ----- ''' self.frameWidth = tk.Frame(self.window) self.frameWidth.pack(side=tk.TOP, fill=tk.BOTH, expand=False) self.label = tk.Label(self.frameWidth, text="Width (px)") self.label.pack(side=tk.LEFT, fill=tk.NONE, expand=False, padx=5, pady=5, anchor="w") self.widthTextBox = tk.Entry(self.frameWidth, width=5) self.widthTextBox.pack(side=tk.LEFT, fill=tk.NONE, expand=False, padx=5, pady=5) self.widthTextBox.insert(0, '1280') ''' ----- Settings ----- ''' self.separ = ttk.Separator(self.window, orient=tk.HORIZONTAL) self.separ.pack(side=tk.TOP, fill=tk.BOTH, expand=False, padx=5, pady=0) self.frameSett = tk.Frame(self.window) #Frame for all checkboxes self.frameSett.pack(side=tk.TOP, fill=tk.BOTH, expand=False, anchor='n') self.frame1 = tk.Frame( self.frameSett ) #Subframe to put the first two checboxes on same row self.frame1.pack(side=tk.TOP, fill=tk.BOTH, expand=False) self.checkBoxDelete = tk.Checkbutton( self.frame1, text="Delete original", variable=self.settings.deleteOriginal) self.checkBoxDelete.pack(side=tk.LEFT, fill=tk.NONE, expand=False, padx=5, pady=0, anchor="w") self.checkBoxDeleteTemp = tk.Checkbutton( self.frame1, text="Delete temp folder", variable=self.settings.deleteTemp) self.checkBoxDeleteTemp.pack(side=tk.RIGHT, fill=tk.NONE, expand=False, padx=5, pady=0, anchor="w") self.checkBoxSmart = tk.Checkbutton( self.frameSett, text="Smart resizing (detect doublepages, etc.)", variable=self.settings.smartResize) self.checkBoxSmart.pack(side=tk.TOP, fill=tk.NONE, expand=False, padx=5, pady=0, anchor="w") self.checkBoxOnlyReduce = tk.Checkbutton( self.frameSett, text="Only reduce size, don't increase", variable=self.settings.onlyReduce) self.checkBoxOnlyReduce.pack(side=tk.TOP, fill=tk.NONE, expand=False, padx=5, pady=0, anchor="w") self.separ = ttk.Separator(self.window, orient=tk.HORIZONTAL) self.separ.pack(side=tk.TOP, fill=tk.BOTH, expand=False, padx=5, pady=5) ''' ----- Buttons ----- ''' self.frameStartBtns = tk.Frame(self.window) self.frameStartBtns.pack(side=tk.TOP, fill=tk.BOTH, expand=False, anchor='n') self.font1 = font.Font(size=20) self.buttonResize = tk.Button( self.frameStartBtns, text="Resize", font=self.font1, height=1, command=lambda: GlobalControl.ResizeComic( self.pathTextBox.get(), int(self.widthTextBox.get()), self. settings)) self.buttonResize.pack(side=tk.TOP, fill=tk.BOTH, expand=False, padx=10, pady=5) self.frame1 = tk.Frame(self.frameStartBtns) self.frame1.pack(side=tk.TOP, fill=tk.BOTH, expand=False, anchor='n') self.label = tk.Label(self.frame1, text="Substeps:") self.label.pack(side=tk.LEFT, fill=tk.NONE, expand=True, padx=0, pady=0) self.buttonExtractAndPreview = tk.Button( self.frame1, text="1/2\nExtract & preview", height=2, command=lambda: GlobalControl.ExtractAndPreview( self.pathTextBox.get(), self.settings)) self.buttonExtractAndPreview.pack(side=tk.LEFT, fill=tk.NONE, expand=False, padx=0, pady=5) self.buttonResize = tk.Button( self.frame1, text="2/2\nResize & compress", height=2, command=lambda: GlobalControl.ResizeAndCompress( self.pathTextBox.get(), int(self.widthTextBox.get()), self. settings)) self.buttonResize.pack(side=tk.LEFT, fill=tk.NONE, expand=False, padx=5, pady=5) self.separ = ttk.Separator(self.window, orient=tk.HORIZONTAL) self.separ.pack(side=tk.TOP, fill=tk.BOTH, expand=False, padx=5, pady=5) ''' ----- Footer ----- ''' self.frameFooter = tk.Frame(self.window) self.frameFooter.pack(side=tk.TOP, fill=tk.BOTH, expand=False, anchor='n') self.checkBoxClose = tk.Checkbutton( self.frameFooter, text="Close when finished", variable=self.settings.closeWhenFinished) self.checkBoxClose.pack(side=tk.LEFT, fill=tk.NONE, expand=False, padx=5, pady=0, anchor="w") self.buttonContextMenu = tk.Button( self.frameFooter, text="Add context\nmenu item", command=ContextMenu.AddToContextMenu) self.buttonContextMenu.pack(side=tk.RIGHT, fill=tk.NONE, expand=False, padx=5, pady=5)
from tkinter import Tk as makescreen, Canvas, font from sql import * # MACROS ON = 'ON' OFF = 'OFF' RUN = 'RUN' screen = makescreen() canvas = Canvas(screen, width=500, height=500) screen.update() canvas.pack() rect = canvas.create_rectangle(100, 100, 400, 400, fill='yellow') status_font = font.Font(family="맑은 고딕", size=30) status_text = canvas.create_text(250, 200, text='status', font=status_font) time_font = font.Font(family="맑은 고딕", size=40) time_text = canvas.create_text(250, 300, text='time', font=time_font) seatnumber = '0' building = "'Soongsil Univ'" def update_canvas(): global rect, status_text, time_text sql = SQL() data = sql.select_where( 'ssu_table', 'seat_number=' + seatnumber + " AND name=" + building) status = data[1]
root.destroy() os.system("python3 ~/Desktop/test.py") def customer_care(self): messagebox.showinfo("Contact Number","Please contact +918137080271 for support and assistance.") messagebox.showinfo("Mail id","Otherwise drop a mail to [email protected]") messagebox.showinfo("Customer Care","THANK YOU") #ser.write(b'9') def credits(self): messagebox.showinfo("CREDITS","GUIDES \n Department of Mechanical Engineering \n Dr.M.L.Joy \n Dr.Ashesh Saha") #ser.write(b'9') root = nitc() root.title("KNEE REHABILITATION SYSTEM : NATIONAL INSTITUTE OF TECHNOLOGY, CALICUT") root.geometry('800x480') myFont1 = font.Font(family = 'Helvetica', size = 16, weight = 'bold') myFont = font.Font(family = 'Helvetica', size = 10, weight = 'bold') photo = PhotoImage(file = "~/Music/nitl.png") image = Image.open("/home/udaygirish/Music/nitl.png") #cover= resizeimage.resize_cover(image,[150,150],validate=False) #cover.save('/home/udaygirish/photo.png',image.format) photo = Image.open("/home/udaygirish/Music/nitl.png") nx,ny= photo.size image = photo.resize((int(nx/2),int(ny/2.3)),Image.BICUBIC) photo2= Image.open("/home/udaygirish/Desktop/cpm.jpg") nx,ny = photo2.size image1 = photo2.resize((int(nx/20),int(ny/22)),Image.BICUBIC) image.save("/home/udaygirish/photo.png") image1.save("/home/udaygirish/photo1.png") status = Label(root, text = "Press the respective number for selecting the exercise" , font = myFont ,bd =1 , relief = SUNKEN, anchor = S) status.pack(side = BOTTOM)
def __init__(self): super().__init__() self.title("DES CIPHER") self.default_font = font.Font(font=("Ubuntu", 12), name="TkDefaultFont", exists=TRUE) self.option_add("*Font", self.default_font) #Seleccionar un modo Label(self, text="Select a mode: ").grid(row=0, column=0, sticky=W) modes = [ "", "Electronic Codebook ECB", "Cipher-Block Chaining CBC", "Outout Feedback OFB", "Cipher Feedback CFB" ] self.str_mode = StringVar(self) self.str_mode.set("Electronic Codebook ECB") self.mode_menu = OptionMenu(self, self.str_mode, *modes) self.mode_menu.grid(row=0, column=1, padx=0, pady=10) # Llave Label(self, text="Key: ").grid(row=1, column=0, sticky=W) self.str_key = StringVar(self) self.key_input = Entry(self, textvariable=self.str_key) self.key_input.grid( row=1, column=1, padx=0, pady=0, sticky=W, ) # Vector inicial Label(self, text="Initial vector:").grid(row=3, column=0, pady=10, sticky=W) self.str_iv = StringVar(self) self.iv_input = Entry(self, textvariable=self.str_iv) self.iv_input.grid(row=3, column=1, pady=10, sticky=W) # Imagen Label(self, text="Select image").grid(row=4, column=0, pady=10, sticky=W) self.str_filename = StringVar(self) self.select_button = Button(self, text="Select", command=self.handleSelect) Label(self, textvariable=self.str_filename).grid(row=4, column=1, sticky=W) self.select_button.grid(row=4, column=1, sticky=E) # Elegir accion self.radio_var = IntVar() self.radio_encrypt = Radiobutton(self, variable=self.radio_var, text="Encrypt", value=1) self.radio_encrypt.grid(row=5, column=0) self.radio_encrypt.select() self.radio_decrypt = Radiobutton(self, variable=self.radio_var, text="Decrypt", value=2) self.radio_decrypt.grid(row=5, column=1) Button(self, text="GO!!", width=30, command=self.handleButtonGo, bg="#91ff89").grid(row=6, column=0, columnspan=2, pady=10) # Notas Label(self, text="*Notes", font=("Ubuntu", 7)).grid(row=7, column=0, columnspan=2, padx=0, pady=0, sticky=W) Label(self, text="- Key length must be 8 bytes", font=("Ubuntu", 7)).grid(row=8, column=0, columnspan=2, padx=0, pady=0, sticky=W) Label(self, text="- Initial vector length must be 8 bytes", font=("Ubuntu", 7)).grid(row=9, column=0, columnspan=2, padx=0, pady=0, sticky=W) Label(self, text="- Initial vector will be ignored for ECB mode", font=("Ubuntu", 7)).grid(row=10, column=0, columnspan=2, padx=0, pady=0, sticky=W) self.complete_filename = StringVar(self)
frame_users = Frame(root, bg="#2D2D44", width=130) frame_users.pack(anchor=W, fill=Y, expand=False, side=LEFT) lbl_users = Label(frame_users, text="Users List", bg='#2D2D44', fg="white") lbl_users.pack(anchor=N) btn_sel_user = Button(frame_users, text='Select user', command=select_user) btn_sel_user.pack(anchor=S, pady=5) lbox = Listbox(frame_users, width=12, bg='#2D2D44', bd='0', font=font.Font(size=14), fg='white', highlightbackground='#1E1E2C') lbox.pack(anchor=W, fill=Y, side=LEFT) # END of USERS FRAME ################################################################## ################################################################## # CONTENT FRAME content_frame = Frame(root, bg="#2D2D44") content_frame.pack(anchor=N, fill=BOTH, expand=True, side=LEFT) # END of CONTENT FRAME ##################################################################
def __init__(self): ... self.cannot_use_font = font.Font(family="ubuntu", size=28, weight=font.BOLD) self.item_in_use = "" self.has_won = False ... self.help_history_var_1 = tk.StringVar(self.right_frame) self.help_history_var_2 = tk.StringVar(self.right_frame) self.help_history_var_3 = tk.StringVar(self.right_frame) help_history_box_1 = tk.Label(self.right_frame, textvar=self.help_history_var_1, bg="black", fg="white", padx=10, pady=10) help_history_box_2 = tk.Label(self.right_frame, textvar=self.help_history_var_2, bg="black", fg="white", padx=10, pady=10) help_history_box_3 = tk.Label(self.right_frame, textvar=self.help_history_var_3, bg="black", fg="white", padx=10, pady=10) help_history_box_1.pack(side=tk.TOP, fill=tk.X, padx=10) help_history_box_2.pack(side=tk.TOP, fill=tk.X, padx=10) help_history_box_3.pack(side=tk.TOP, fill=tk.X, padx=10) ... inventory_row_1 = tk.Frame(self.inventory_space, pady=10) inventory_row_2 = tk.Frame(self.inventory_space, pady=10) inventory_row_3 = tk.Frame(self.inventory_space, pady=10) inventory_slot_1 = tk.Button(self.inventory_row_1, image=self.question_mark_image, width=50, height=50, bg="black", command=lambda: self.use_item(0)) inventory_slot_2 = tk.Button(self.inventory_row_2, image=self.question_mark_image, width=50, height=50, bg="black", command=lambda: self.use_item(1)) inventory_slot_3 = tk.Button(self.inventory_row_3, image=self.question_mark_image, width=50, height=50, bg="black", command=lambda: self.use_item(2)) item_name_1 = tk.StringVar(self.inventory_row_1) item_name_2 = tk.StringVar(self.inventory_row_2) item_name_3 = tk.StringVar(self.inventory_row_3) self.item_label_vars = [self.item_name_1, self.item_name_2, self.item_name_3] item_label_1 = tk.Label(self.inventory_row_1, textvar=self.item_name_1, anchor="w") item_label_2 = tk.Label(self.inventory_row_2, textvar=self.item_name_2, anchor="w") item_label_3 = tk.Label(self.inventory_row_3, textvar=self.item_name_3, anchor="w") inventory_row_1.pack(fill=tk.X, expand=1) inventory_row_2.pack(fill=tk.X, expand=1) inventory_row_3.pack(fill=tk.X, expand=1) inventory_slot_1.pack(side=tk.LEFT, padx=(100,20)) item_label_1.pack(side=tk.LEFT, fill=tk.X, expand=1) inventory_slot_2.pack(side=tk.LEFT, padx=(100,20)) item_label_2.pack(side=tk.LEFT, fill=tk.X, expand=1) inventory_slot_3.pack(side=tk.LEFT, padx=(100,20)) item_label_3.pack(side=tk.LEFT, fill=tk.X, expand=1) ...
except Exception as e: print(e) alert.config(text="Unknown Error!") else: listbox.insert(END, query) downloadQueue.append(query) if __name__ == "__main__": root = Tk() root.title("Spotify Downloader") root.geometry("600x450") root.resizable(width=False, height=False) ft = tkFont.Font(family='Agency FB', size=14) querEntry = Entry(root, borderwidth="1px", font=ft, fg="#333333", justify="center") querEntry.place(x=50, y=30, width=380, height=50) ft = tkFont.Font(family='Agency FB', size=10) addBtn = Button(root, activeforeground="#ffffff", activebackground="#1DB954", bg="#008000", command=addQuery, font=ft, fg="#ffffff",
# # if we are not using it as a library if (drv8825RunMain): # # create the plate control thread motor_control = stepMotorDriver8825() # # create TCP-IP server to build remote control connections control_terminal = motorControlTerminalServer(motor_control) # # create GUI win = Tk() winFont = font.Font(family="Helvetica", size=15, weight="bold") def exitProgram(): print("Exit button pressed!") win.destroy() def goToPosition(): print("demand of plate movement") motor_control.moveTo(positionScale.get()) def goToListPosition(): print("demand of plate movement") angle = float(posList.get(ACTIVE)) motor_control.moveTo(int(angle)) positionScale.set(int(angle))
from tkinter import * from tkinter import filedialog import TranslateFunc import tkinter.font as font window = Tk() window.resizable(False, False) window.title("Morse Translator") mainFrame = Frame(window, width=400) mainFrame.pack() filePath = "" radioChoose = IntVar() savePath = "" titleFont = font.Font(family="Helvtica", size=30) infoFont = font.Font(family="Helvtica", size=15) chooseFileButton = Button(window, text="Choose File to Translate") saveFolderButton = Button(window, text="Choose Folder to Save") filePathLabel = Label(window, text="") folderPathLabel = Label(window, text="") errorLabel = Label(window, text="") def chooseFile(): global filePath filePath = filedialog.askopenfilename(initialdir="/", title="Select file", filetypes=(("txt files", "*.txt"), ("all files", "*.*")))
def __init__(self, PlayerNumber, PlayerNames, PlayerColors, pypresence): """ fonction permettant d'initialiser un objet de la classe MAINGAME représentant le jeu principal :param PlayerNumber: :param PlayerNames: :param PlayerColors: :param pypresence: """ self.pypresenceRPC = pypresence self.playerNumber = PlayerNumber self.fenetre = Tk() self.fenetre.title("Snakes & Ladders") self.fenetre.geometry("800x600") try: self.fenetre.iconbitmap( find_data_file("images/snakes-and-ladders.ico")) except TclError: tkmessage.showwarning("Attention", "Vous avez supprimé le logo !") pass self.fenetre.resizable(False, False) self.PlayerNames = PlayerNames self.win = False self.Terrain = Canvas(self.fenetre, height=600, width=800) self.Terrain.pack(anchor="nw") self.carreau = [[ self.Terrain.create_rectangle(i * 60, j * 60, (i + 1) * 60, (j + 1) * 60, fill="#FFFFFF") for i in range(10) ] for j in range(10)] self.labels = [[ self.Terrain.create_text(i * 60 + 50, j * 60 + 10) for i in range(10) ] for j in range(10)] self.labels.reverse() self.carreau.reverse() for i in range(1, 10, 2): self.labels[i].reverse() self.carreau[i].reverse() for i in range(10): for j in range(10): self.Terrain.itemconfigure(self.labels[i][j], text=(j + 1) + (i * 10)) self.genLevel() self.placeObjects() if self.playerNumber == 1: self.player = [ self.Terrain.create_oval(10, 550, 50, 590, fill=PlayerColors[0], outline="grey") ] if pypresenceEnabled and self.pypresenceRPC is not None: self.pypresenceRPC.update( state="En jeu !", large_image="snakes-and-ladders", start=time.time(), large_text="PyLadders&Snakes", small_image="oneplayer", small_text="Mode 1 joueur !", ) elif self.playerNumber == 2: self.player = [ self.Terrain.create_oval(4, 560, 24, 580, fill=PlayerColors[0], outline="grey"), self.Terrain.create_oval(36, 560, 56, 580, fill=PlayerColors[1], outline="grey"), ] if pypresenceEnabled and self.pypresenceRPC is not None: self.pypresenceRPC.update( state="En jeu !", large_image="snakes-and-ladders", start=time.time(), large_text="PyLadders&Snakes", small_image="twoplayers", small_text="Mode 2 joueurs !", ) elif self.playerNumber == 3: self.player = [ self.Terrain.create_oval(14, 560, 24, 570, fill=PlayerColors[0], outline="grey"), self.Terrain.create_oval(36, 560, 46, 570, fill=PlayerColors[1], outline="grey"), self.Terrain.create_oval(24, 580, 34, 590, fill=PlayerColors[2], outline="grey"), ] if pypresenceEnabled and self.pypresenceRPC is not None: self.pypresenceRPC.update( state="En jeu !", large_image="snakes-and-ladders", start=time.time(), large_text="PyLadders&Snakes", small_image="threeplayers", small_text="Mode 3 joueurs !", ) else: self.player = [ self.Terrain.create_oval(14, 560, 24, 570, fill=PlayerColors[0], outline="grey"), self.Terrain.create_oval(36, 560, 46, 570, fill=PlayerColors[1], outline="grey"), self.Terrain.create_oval(14, 580, 24, 590, fill=PlayerColors[2], outline="grey"), self.Terrain.create_oval(36, 580, 46, 590, fill=PlayerColors[3], outline="grey"), ] if pypresenceEnabled and self.pypresenceRPC is not None: self.pypresenceRPC.update( state="En jeu !", large_image="snakes-and-ladders", start=time.time(), large_text="PyLadders&Snakes", small_image="fourplayers", small_text="Mode 4 joueurs !", ) self.playerPositionGap = [ [50], [56, 24], [46, 24, 36], # gap entre la position de la case et celle du joueur [46, 24, 46, 24], ] # sur l'axe x self.playerPositionGapY = [ [50], [40, 40], [40, 40, 20], # gap entre la position de la case et celle du joueur [40, 40, 20, 20], ] # sur l'axe y self.playerPositionY = [ # position minimum du joueur sur l'axe Y [[550, 590]], # ou peut aussi être sur le max de l'axe X [[544, 564], [576, 596]], [[554, 564], [576, 586], [564, 574]], [[554, 564], [576, 586], [554, 564], [576, 586]], ] self.playerPositionX = [ # position minimum du joueur sur l'axe X [[10, 50]], # ou peut aussi être position minimum sur l'axe Y [[4, 24], [36, 56]], [[14, 24], [36, 46], [24, 34]], [[14, 24], [36, 46], [14, 24], [36, 46]], ] self.playerPositionYMax = [ # position du joueur maximum sur l'axe Y [[10, 50]], [[20, 40], [20, 40]], [[20, 30], [20, 30], [40, 50]], [[20, 30], [20, 30], [40, 50], [40, 50]], ] self.dice = self.Terrain.create_rectangle(655, 25, 750, 120, fill="white", tags="dice") self.dice_face = self.Terrain.create_text( 702.5, 72.5, fill="black", font=tkfont.Font(family="Helvetica", size=36, weight="bold"), tags="dice_face", ) self.playerturnlabel = self.Terrain.create_text( 702.5, 130, text="Au tour de " + str(self.PlayerNames[0])) self.playerturn = 0 self.Terrain.tag_bind("dice_face", "<Button-1>", self.onDiceClick) self.Terrain.tag_bind("dice", "<Button-1>", self.onDiceClick) self.fenetre.mainloop()
from gtts import gTTS import threading as th from pygame import mixer window = Tk() mixer.init() window.title("JENIL WIKIPEDIA") window.configure(padx=2,pady=2,bg="#ffffff", borderwidth=0, relief="flat") window.wm_attributes('-alpha',0.955) window.minsize(350,300) window.maxsize(800,380) window.resizable(0,0) fontStyle = tkFont.Font(family="comic sans ms", size=10, weight="bold") fontStyle1 = tkFont.Font(family="comic sans ms", size=10, weight="bold") fontStyle2 = tkFont.Font(family="comic sans ms", size=6, weight="bold") fontStyle3 = tkFont.Font(family="comic sans ms", size=10, weight="bold") fontStyle4 = tkFont.Font(family="comic sans ms", size=9, weight="bold") def move_window(event): global x global y window.geometry('+{0}+{1}'.format(event.x_root - x - 5, event.y_root - y - 4)) def get_mouse(event): global x global y x,y = event.x,event.y
def global_print(output): global app app.add_to_console(output) def print_test(): counter = 0 while (counter < 100): counter += 1 global_print("this is a test") try: root = Tk() root.title("Dynamic Plotter (Ver 2.0)") font = tkFont.Font(family="Consolas", size=10, weight="normal") basic_unit = font.measure("0") root.geometry(str(53 * basic_unit) + "x" + str(65 * basic_unit)) root.resizable(0, 0) app = Application(root) app.start() keyboard_detect = Thread(target=threaded_function, ) keyboard_detect.start() global_print("key board stroker thread running") root.protocol("WM_DELETE_WINDOW", app.close) root.mainloop() keyboard_detect.join() except RuntimeError as e:
if Count >= total_num: acc = Acc / total_num log_text = "Done! The attack detection accuracy is {.2f}!".format( acc) send_information(Receive_window, log_text) break time.sleep(2) run_once_button.config(state='normal') run_all_button.config(state='normal') top = tk.Tk() top.title('Multi-scale Defense of Adversarial Images') ft = tkFont.Font(family='Fixdsys', size=10, weight=tkFont.BOLD) top.geometry('960x470') top.resizable(width=False, height=False) Label = tk.Label( top, text="Step4: Conducting multiscale detection on adversarial images", font=ft, anchor='w') Label.place(x=10, y=10) # Select network button select_network = tk.Label(top, text="Select Network:") select_network.place(x=10, y=50) net_comvalue = tk.StringVar() #窗体自带的文本,新建一个值 net_comboxlist = ttk.Combobox(top, textvariable=net_comvalue, width=25) #初始化 net_comboxlist["values"] = ("LeNet", "ResNet32", "Vgg16")
def __init__(self, parent, controller, clicked): tk.Frame.__init__(self, parent) self.count = 0 self.running = 1 self.main_url = '' self.treeSelection = '' self.queue = controller.queue self.infoQueue = Queue.Queue() self.CFnumQueue = Queue.Queue() self.flagQueue = Queue.Queue() self.controller = controller self.clicked = clicked self.login_page = self.controller.get_page(LoginPage) style = Style() style.configure("BW.TLabel", font=('Montserrat', '10', 'bold'), foreground="#112D25", background="#DBDDDC") style.configure("BW.TButton", font=('Montserrat', '10', 'bold'), foreground="#112D25", background="#DBDDDC") style.configure("BW.TEntry", background="gray90") style.configure("BW.TCheck", foreground="#112D25", background="#FFFFFF") self.CF_number = Label(self, text="Complaint Folder:", style="BW.TLabel") self.CF_number.config(font=('Helvetica', '10', 'bold'), foreground="#112D25", background="#FFFFFF") self.CFnum = Entry(self, validate="key", validatecommand=(self.register(self.validate), '%P')) self.CFnum.bind('<Return>', lambda x: self.submit(self.CFnum.get(), self.main_url)) self.msg = Label(self, style="BW.TLabel") self.authorName = Label( self, text=u'\u00a9' + " Designed & Developed by Prashanth Kumar & Andrew Jesiah") self.authorName.config(font=('Montserrat', '8'), foreground="#112D25", background="#FFFFFF") helv36 = font.Font(family='Helvetica', size=9) self.button1 = tk.Button( self, text="Submit", command=lambda: self.submit(self.CFnum.get(), self.main_url)) self.button1.config(relief='flat', bg='#737370', fg="#FFFFFF", height=2, width=38) self.button1['font'] = helv36 self.button1.config(state='disabled') self.button1.bind( '<Return>', lambda x: self.submit(self.CFnum.get(), self.main_url)) self.button2 = tk.Button(self, text="Logout", command=lambda: self.logout()) self.button2.config(relief='flat', bg='#737370', fg="#FFFFFF", height=1, width=10) self.button2['font'] = helv36 # Set the treeview self.tree = Treeview(self, columns=('CF number', 'Complaint Status')) self.tree.heading('#0', text='No', anchor='w') self.tree.heading('#1', text='Complaint Folder', anchor='w') self.tree.heading('#2', text='Complaint Status') self.tree.column('#0', stretch=tk.YES, width=33, anchor='w') self.tree.column('#1', stretch=tk.YES, width=100, anchor='w') self.tree.column('#2', stretch=tk.YES, width=250, anchor='w') self.treeview = self.tree self.treeview.bind("<ButtonRelease-1>", lambda event: self.tree_select_event(event)) self.vsb = tk.Scrollbar(self, orient="vertical", command=self.tree.yview) self.tree.configure(yscrollcommand=self.vsb.set) self.internet = Label(self, text="Checking...") self.internet.config(font=('Helvetica', '11'), foreground="black", background="#FFFFFF") self.delButton = tk.Button( self, text="Delete", command=lambda: self.delete(self.treeSelection)) self.delButton.config(relief='flat', bg='#737370', fg="#FFFFFF", height=1, width=8) self.delButton['font'] = helv36 self.previewButton = tk.Button( self, text="View", command=lambda: self.viewPreview(self.CFnum.get(), self. treeSelection, self.main_url)) self.previewButton.config(relief='flat', bg='#737370', fg="#FFFFFF", height=1, width=8) self.previewButton['font'] = helv36 # Initialize the counter self.count = 0 self.CF_number.place(x='35', y='20') self.CFnum.place(x='157', y='20') self.previewButton.place(x='300', y='17') #self.msg.place(x='18', y='40') self.button1.place(x='200', y='80', anchor='center') self.tree.place(x='0', y='140') self.delButton.place(x='4', y='385') self.button2.place(x='315', y='385') #self.internet.place(x='270', y='420') self.authorName.place(x='87', y='442') self.vsb.place(x='380', y='140', height=228) self.CFnum.focus() '''
Created on Thu Nov 19 17:42:18 2020 @author: danie """ from tkinter import * from PIL import ImageTk, Image import tkinter.font as tkFont from tkinter import messagebox import cx_Oracle from populate import * #from create_del import * root = Tk() root.title("Gym Login") root.geometry("400x200") Header = tkFont.Font(family="times new roman", size=25) global f def open(): ''' Widow 2, destroy previous window 3 options: delete table, create table, populate table populate table will send you to a new window ''' root.destroy() root2 = Tk() root2.title("Main Page")
******************************************** Login de usuario entrada del usuario a sus datos de la agenda ******************************************** """ v_login = Tk() #variables declaradas para el get del textBox usuario = StringVar() password = StringVar() fondoLogin = PhotoImage(file="imagenes/fondo_login.png") v_login.title("Agenda") v_login.geometry("600x400") #Bloquear el redimencionamiento de la ventana v_login.resizable(0, 0) tituloLogin = font.Font(family='Bernard MT Condensed', size=25) labelsLogin = font.Font(family='Lucida Calligraphy', size=12) textBtnLogin = font.Font(family='Bookman Old Style', size=12) FontLogin = "******" bgLogin = "******" #label Login labelFondoLogin = Label(v_login, image=fondoLogin).place(x=0, y=0) labelTituloLogin = Label(v_login, text="Login", bg="#44A6F8", font=tituloLogin, fg=FontLogin).place(x=260, y=40) labelUsuario = Label(v_login, text="Usuario:", font=labelsLogin,
labelfont = ('times', 20, 'bold') labelfont1 = ('times', 15, 'bold') labelfont2 = ('times', 18, 'bold') head = ttk.Label(win, text="\n\tSCHOOL MANAGEMENT SYSTEM\t\n") head.pack() head.configure(background="blue", width="200") head.config(font=labelfont2) teacher_man = ttk.Label(win, text="\nStudent Managment\n") teacher_man.pack() teacher_man.configure(background="grey") teacher_man.config(font=labelfont1) head1 = ttk.Label(win, text="Student Registration") head1.pack() head1.configure(background="grey") head1.config(font=labelfont1) myFont = font.Font(size=15) lab1 = ttk.Label(win, text="Rollno:") lab1.pack() lab1.configure(background="grey") lab1.config(font=labelfont2) cours_var = tk.StringVar() corus_ent = ttk.Entry(win, width=30, textvariable=cours_var) corus_ent.pack() corus_ent.config(font=labelfont1) lab2 = ttk.Label(win, text="Student Name") lab2.pack() lab2.configure(background="grey") lab2.config(font=labelfont2) name_var = tk.StringVar() name_ent = ttk.Entry(win, width=30, textvariable=name_var) name_ent.pack()
elif stage == 'Swing': swing(video_path) messagebox.showinfo(title='Info!', message='Finish analyze!') elif stage == 'Stroke': shot(video_path) messagebox.showinfo(title='Info!', message='Finish analyze!') elif stage == 'After stroke': aftershot(video_path) messagebox.showinfo(title='Info!', message='Finish analyze!') window = tk.Tk() window.title('Tennis tool') window.iconbitmap('icon.ico') ft = tf.Font(family='TimeNewRoman', size=14) tk.Label(window, text="select video").grid(row=0) tk.Label(window, text="select stage").grid(row=1) file = tk.Entry(window, width=22) file.grid(row=0, column=1, pady=10) tk.Button(text="Browse", width=10, command=select_file).grid(row=0, column=2, pady=5) cmb = ttk.Combobox(window) cmb.grid(row=1, column=1) cmb['value'] = ('Ready', 'Swing', 'Stroke', 'After stroke') tk.Button(text="submit", width=10, command=submit).grid(row=2, columnspan=3, pady=5) # columnspan=3 跨三列
def update_rows(tuple_rows): def get_rows(): i_sl_no = data_col[1] i_name = e[1].get() i_e_mail = e[2].get() i_flat = e[3].get() i_tower = e[4].get() i_area = e[5].get() i_parking = e[6].get() i_recpt_fees = e[7].get() i_addr = e[8].get() i_contact_no = e[9].get() i_tmstmp = data_col[11] #print(i_sl_no," ",i_name," ", i_e_mail," ", i_flat," ", i_tower," ", i_area," ", i_parking," ", i_recpt_fees," ", i_addr," ", i_contact_no," ",i_tmstmp) ao.updateData(i_sl_no, i_name, i_e_mail, i_flat, i_tower, i_area, i_parking, i_recpt_fees, i_addr, i_contact_no, i_tmstmp) def data_updated_sucessfully(): row_no = 0 parent3 = Tk() row = Frame(parent3) parent3.title("FLAT-INVENTORY JIMSOFT ( UPDATED ? )") parent3.geometry("500x50+200+200") #global data_valid text = "Data updated sucessfully" tk.Label(parent3, justify=tk.LEFT, padx=10, pady=10, text=text, font=font.Font(family='Helvetica', size=12, weight='bold')).grid(row=row_no, column=1, sticky=W, pady=4) data_valid = 0 # everytime it is set to 0, on clscreen row_no = 1 # row number parent6 = Tk() parent6.title("FLAT-INVENTORY JIMSOFT (UPDATE ROWS MODE)") parent6.geometry("800x800+200+200") data_col = [""] for data in tuple_rows: data_col.append(data) print(data_col) for data, num in info: #print(data,"\t",num) tk.Label(parent6, justify=tk.LEFT, padx=10, pady=10, text=data, font=font.Font(family='Helvetica', size=20, weight='bold')).grid(row=row_no, column=1, sticky=W, pady=4) e[num] = tk.Entry(parent6, width=100) e[num].insert(END, data_col[num + 1]) # to insert an existing data #print("####",e[num]) e[num].grid(row=row_no, column=2, sticky=W, pady=4) row_no = row_no + 2 Button(parent6, justify=tk.LEFT, padx=10, pady=10, text='update data', command=Generic.combine_funcs( get_rows, data_updated_sucessfully)).grid(row=20, column=1, sticky=W, pady=4) Button(parent6, justify=tk.LEFT, padx=10, pady=10, text='show', command=GUIfunctions.update).grid(row=20, column=2, sticky=W, pady=4)
def __init__(self, master): self.messages = dict() self.server_label = Label(master, text="Server", font=16) self.server_label.place(x=5, y=5, height=30, width=50) self.server = Entry(master, font=16) self.server.place(x=60, y=10, height=22, width=200) self.server.insert(END, 'pop.gmail.com') self.checker = Radiobutton(master, text="", variable=1, fg="red") self.checker.place(x=270, y=10) self.login_label = Label(master, text="Login", font=16) self.login_label.place(x=5, y=35, height=30, width=40) self.login = Entry(master, font=16) self.login.place(x=50, y=40, height=22, width=200) self.login.insert(END, 'recent:[email protected]') self.delete_button = Button(master, text="Delete", font=16, command=self.delete_func) self.delete_button.place(x=645, y=35, height=30, width=100) self.password_label = Label(master, text="Password", font=16) self.password_label.place(x=255, y=35, height=30, width=70) self.password = Entry(master, font=16, show='*') self.password.place(x=330, y=40, height=22, width=200) self.login_button = Button(master, text="Login", font=16, command=self.login_func) self.login_button.place(x=535, y=35, height=30, width=100) self.quit_button = Button(master, text="X", font=16, command=self.quit_func) self.quit_button.place(x=755, y=35, height=30, width=20) container = ttk.Frame() container.place(x=0, y=80, height=250, width=800) self.tree = ttk.Treeview(columns=header, show="headings") vsb = ttk.Scrollbar(orient="vertical", command=self.tree.yview) hsb = ttk.Scrollbar(orient="horizontal", command=self.tree.xview) self.tree.configure(yscrollcommand=vsb.set, xscrollcommand=hsb.set) self.tree.grid(column=0, row=0, sticky='nsew', in_=container) vsb.grid(column=1, row=0, sticky="ns", in_=container) hsb.grid(column=0, row=1, sticky='ew', in_=container) container.grid_columnconfigure(0, weight=1) container.grid_rowconfigure(0, weight=1) for col in header: self.tree.heading(col, text=col.title().upper()) self.tree.column(col, width=font.Font().measure(col.title())) self.tree.bind("<Double-1>", self.OnDoubleClick) self.listbox = Text() self.listbox.configure(state='normal') self.listbox.place(x=0, y=330, height=370, width=800) scrollbar = Scrollbar(self.listbox, orient="vertical", command=self.listbox.yview) scrollbar.grid(row=0, column=1) self.listbox['yscrollcommand'] = scrollbar.set scrollbar.pack(side=RIGHT, fill=Y) self.progress = ttk.Progressbar(master, orient='horizontal', length=490, mode='determinate') self.progress.place(x=300, y=10, height=22) self.progress["value"] = 0
def __init__(self): tk.Tk.__init__(self) self.baseWindow = BaseWindow(self) self.minsize(175, 50) # Set title and icon for alt+tab and taskbar self.wm_title("PyEveLiveDPS") try: self.iconbitmap(sys._MEIPASS + '\\app.ico') except Exception: try: self.iconbitmap("app.ico") except Exception: pass self.addToTaskbar() # label that appears at the top of the window in special modes like simulation and playback modes self.topLabel = tk.Label(self, text="Simulation Mode", fg="white", background="black") font = tkFont.Font(font=self.topLabel['font']) font.config(slant='italic') self.topLabel['font'] = font self.topLabel.grid(row="5", column="5", columnspan="8") self.topLabel.grid_remove() self.makeDraggable(self.topLabel) # Other items for setting up the window self.addQuitButton() self.addCollapseButton(self, row="5", column="17") tk.Frame(self, height=1, width=5, background="black").grid(row="5", column="16") self.addMinimizeButton(self, row="5", column="15") self.addMenus() # Container for our "dps labels" and graph self.middleFrame = tk.Frame(self, background="black") self.middleFrame.columnconfigure(0, weight=1) self.middleFrame.rowconfigure(1, weight=1) self.middleFrame.grid(row="10", column="1", columnspan="19", sticky="news") self.makeDraggable(self.middleFrame) self.middleFrame.bind("<Map>", self.showEvent) self.protocol("WM_TAKE_FOCUS", lambda: self.showEvent(None)) self.labelHandler = labelHandler.LabelHandler(self.middleFrame, background="black") self.labelHandler.grid(row="0", column="0", sticky="news") self.makeDraggable(self.labelHandler) # set the window size and position from the settings self.geometry("%sx%s+%s+%s" % (settings.getWindowWidth(), settings.getWindowHeight(), settings.getWindowX(), settings.getWindowY())) self.update_idletasks() # The hero of our app self.graphFrame = graph.DPSGraph(self.middleFrame, background="black", borderwidth="0") self.graphFrame.grid(row="1", column="0", columnspan="3", sticky="nesw") self.makeDraggable(self.graphFrame.canvas.get_tk_widget()) # details window is a child of the main window, but the window will be hidden based on the profile settings self.detailsWindow = DetailsWindow(self) self.fleetWindow = FleetWindow(self) # the animator is the main 'loop' of the program self.animator = animate.Animator(self) self.bind('<<ChangeSettings>>', lambda e: self.animator.changeSettings()) self.graphFrame.readjust(0) if settings.getGraphDisabled(): self.graphFrame.grid_remove() else: self.graphFrame.grid() self.labelHandler.lift(self.graphFrame) self.makeAllChildrenDraggable(self.labelHandler) logging.info('main window (and subcomponents) initialized')