def main(): if platform.system() != 'Linux': showerror('Error', 'Linux Is Required') return 1 global window window = ThemedTk(theme='equilux', className='mcpil') window.title('MCPIL') window.geometry('512x400') window.resizable(True, True) tabs = ttk.Notebook(window) tabs.add(play_tab(tabs), text='Play') tabs.add(features_tab(tabs), text='Features') tabs.add(multiplayer_tab(tabs), text='Multiplayer') tabs.add(settings_tab(tabs), text='Settings') tabs.add(about_tab(tabs), text='About') tabs.pack(fill=BOTH, expand=True) load() save() window.wm_protocol('WM_DELETE_WINDOW', quit) signal.signal(signal.SIGINT, lambda *args: quit()) try: window.mainloop() except KeyboardInterrupt: quit() return 0
def __init__(self): # super().__init__() pass # root window window = ThemedTk(theme="arc") window.title('Theme Demo') window.geometry('400x300') window.style = ttk.Style(self) # label label = ttk.Label(window, text='Name:') label.grid(column=0, row=0, padx=10, pady=10, sticky='w') # entry textbox = ttk.Entry(window) textbox.grid(column=1, row=0, padx=10, pady=10, sticky='w') # button btn = ttk.Button(window, text='Show') btn.grid(column=2, row=0, padx=10, pady=10, sticky='w') # radio button window.selected_theme = ttk.StringVar() theme_frame = ttk.LabelFrame(self, text='Themes') theme_frame.grid(padx=10, pady=10, ipadx=20, ipady=20, sticky='w') for theme_name in window.style.theme_names(): rb = ttk.Radiobutton(theme_frame, text=theme_name, value=theme_name, variable=window.selected_theme, command=window.change_theme) rb.pack(expand=True, fill='both')
def init() -> ThemedTk: window = ThemedTk() window.get_themes() window.set_theme('itft1') window.title("Prots2Net app") window.geometry('1080x1080') window.resizable(width=True, height=True) tab_control, tab1, tab2, tab3, tab4 = create_tab_control(window) tree_node = create_protein_tab(tab3) tree_edge = create_edge_tab(tab4) sec_txt, combo_1, combo_2 = create_main_tab(tab1) bar = ttk.Progressbar(tab1, length=100) bar['value'] = 0 bar.grid(column=1, row=6) bar_text = ttk.Label(tab1, anchor="s", text="") bar_text.grid(column=1, row=7) create_plot_tab(tab2, tree_node, tree_edge) tab_control.pack(expand=2, fill='both') btn2 = ttk.Button(tab1, text='Compute Network', command=partial(clicked, sec_txt, combo_1, combo_2, bar, bar_text)) btn2.grid(column=0, row=4, sticky='W') return window
def summary(): if run: window = ThemedTk(theme='arc') window.resizable(0,0) window.geometry('400x400') present_list = [] title_name2 =ttk.Label(window , text = 'Attendance Summary' , font = ('Tw Cen MT',20) , style = "BW.TLabel").place(x = 75 , y = 0) for i in range(2,sheet.max_row): if sheet.cell(row = i , column = req_column).value == 'P': name = sheet.cell(row = i , column = 1).value present_list.append(name) info = ttk.Label(window, text = str(len(present_list))+'/'+str(sheet.max_row-1)+' students are present' , font = ('Tw Cen MT',12)).place(x = 0 , y = 50) progressbar = ttk.Progressbar(window , orient = VERTICAL,length = 220, value = (len(present_list)/(sheet.max_row-1))*100 ).place(x = 340 , y = 50) percent = round(len(present_list)/(sheet.max_row-1)*100, 2) percent_label = ttk.Label(window, text ='{}%\npresence'.format(percent) ).place(x = 340, y = 290) for x in range(0,len(present_list)): lmain_x = ttk.Label(window, text = str(x+1)+'. '+present_list[x], font = ('Tw Cen MT',12)).place(x=0, y=(80 + x*25)) backBtn = ttk.Button(window, text='Return', command=window.destroy).place(x = 280 , y = 350) window.mainloop() else: messagebox.showinfo('Error','There\'s nothing to show yet!')
def main(): def funcExit(): message_box = messagebox.askquestion("Exit", "Do you want to exit?", icon='warning') if message_box == "yes": root.destroy() def funcAddBook(): open_add_book = add_book.AddBook() def funcAddMember(): open_add_member = add_member.AddMember() root = ThemedTk() root.get_themes() root.set_theme("arc") app = Main(root) #MenuBar menu_bar = Menu(root) root.config(menu=menu_bar) file = Menu(menu_bar, tearoff=0) menu_bar.add_cascade(label="File", menu=file) file.add_command(label="Add a Book", command=funcAddBook) file.add_command(label="Add a Member", command=funcAddMember) file.add_command(label="Show Member") file.add_command(label="Exit", command=funcExit) root.title("Library Management System") root.geometry("1280x720+450+150") root.resizable(False, False) root.iconbitmap("image/book_tk.ico") root.mainloop()
def login_screen(): """creates the first screen where the user logs in to the game""" screen = ThemedTk(theme="arc") # creating a window themed "arc" screen.geometry('880x540') screen.title("© Battleship by Shani Daniel ©") screen.configure(background='light blue') style_log = ttk.Style() ttk.Label(text='Welcome to Battleship', font=("Broadway", 50), foreground='black', background='light blue')\ .pack(pady=40) ttk.Label(text='Login:'******'black', background='light blue').pack(pady=20) # writes the main game title and the "login" label username_login = tk.StringVar() password_login = tk.StringVar() ttk.Label(screen, text="Username:"******"Cooper black", 14), foreground='black', background='light blue').pack() tk.Entry(screen, textvariable=username_login).pack() ttk.Label(screen, text="Password:"******"Cooper black", 14), foreground='black', background='light blue').pack() tk.Entry(screen, textvariable=password_login, show='*').pack() # creates the username and password fields def login_click(): login_button_click(screen, username_login, password_login) def register_click(): register(screen) style_log.configure('log.TButton', font=('Cooper Black', 16), foreground='black') style_log.configure('reg.TButton', font=('Cooper Black', 13), foreground='black') ttk.Button(screen, text="Sign in", style='log.TButton', command=login_click).pack(pady=15) ttk.Button(screen, text="Register", style='reg.TButton', command=register_click).pack() # styles and creates the "sign in" and "register" buttons screen.mainloop()
def edit(): tctzn=StringVar() nsc = ThemedTk(theme="arc") nsc=tk.Toplevel() nsc.title("voter_list") nsc.geometry("400x300") nsc.resizable(False,False) nsc.iconbitmap("gov2.ico") l1=ttk.Label(nsc,text="Enter Citizenship Number or Voter ID:") ectzn = Entry(nsc,textvariable=tctzn) l1.place(relx=0.05,rely=0.5) ectzn.place(relx=0.559, rely=0.49) def sreh(*args): global vid flag="" c = sqlite3.connect("voterlist.db", check_same_thread=False) tc = c.execute("SELECT usr,pw,eml,phon,cou,gen,dob,ph,cid,vid,vtsta from voterlist") print(str(tctzn.get())) print("dfd") i=0 for item in tc: if str(item[8]) == str(tctzn.get()) or str(item[9]) == str(tctzn.get()): flag="True" l1.destroy() ectzn.destroy() b1.destroy() la = ttk.Label(nsc) la["text"] = "Information is:\n" + "Name:" + str(item[0]) + "\nPhone Number: " + str( item[3]) + "\nDate of birth: " + str(item[6]) + "\nEmail: " + str( item[2]) + "\nVote Status: " + str(item[10]) la.place(relx=0.01, rely=0.1) vid = (int(item[9]),) def dele(): global vid print(vid) tc = sqlite3.connect("voterlist.db", check_same_thread=False) tc.execute("""DELETE FROM voterlist WHERE vid=(?)""", vid) tc.commit() tc.close() la.destroy() messagebox.showinfo(message="Information deleted !") nsc.destroy() bu1 = ttk.Button(nsc, text="Delete", command=dele) bu1.place(relx=0.6, rely=0.58) bu2 = ttk.Button(nsc, text="Back", command=sreh) bu2.place(relx=0.32, rely=0.58) if flag!="True": messagebox.showinfo(message="No match found!") nsc.destroy() b1 = ttk.Button(nsc, text="Search", command=lambda:sreh(tctzn.get())) b1.place(relx=0.6, rely=0.58) nsc.mainloop()
def show_signup_window(self): root = ThemedTk(theme=self.STYLE) root.geometry("400x250") root.title('Signup') root.resizable(0,0) # title ttk.Label(root, font=('default', 19, 'bold'), text='******Moriarity Point******').grid(row=0, column=0, sticky='w', padx=15) ttk.Separator(root, orient='horizontal').grid(row=1, columnspan=2, sticky='ew') # sub title ttk.Label(root, font=('default', 14, 'bold'), text='Add a new employee').grid(row=2, column=0, sticky='w', padx=5, pady=10) # defs def show_login(): root.destroy() self.show_login_window() def signup_db(): conn = sqlite3.connect('user.db') if not var_pass.get()==var_repass.get(): messagebox.showwarning('Warning!', 'Passwords do not match.') return try: query = "INSERT INTO user_accounts(name, password) VALUES ( '{var_user.get()}', '{var_pass.get()}' )" conn.execute(query) conn.commit() messagebox.showinfo('Success!', 'User account for %s successfuly created!'%var_user.get()) show_login() except: messagebox.showerror('Error!', 'There was an unexpected error!') PADX, PADY = 5, 5 # signup form ttk.Label(root, text='Username:'******'w', padx=PADX, pady=PADY) ttk.Label(root, text='Password:'******'w', padx=PADX, pady=PADY) ttk.Label(root, text='Re-Password:'******'w', padx=PADX, pady=PADY) var_user, var_pass, var_repass = StringVar(), StringVar(), StringVar() ttk.Entry(root, textvariable=var_user, width=25).grid(row=3, column=0, sticky='e', padx=PADX, pady=PADY) ttk.Entry(root, textvariable=var_pass, width=25).grid(row=4, column=0, sticky='e', padx=PADX, pady=PADY) ttk.Entry(root, textvariable=var_repass, width=25).grid(row=5, column=0, sticky='e', padx=PADX, pady=PADY) ttk.Button(root, text='Signup', command=signup_db).grid(row=8, column=0, sticky='e', padx=PADX, pady=PADY) ttk.Button(root, text='Login', command=show_login).grid(row=8, column=0, sticky='w', padx=PADX, pady=PADY) root.mainloop()
def custom_game(self): #change the width, height, and total_mine value and soft initialize the game (without reinitialize all stuff) def return_custom(): self.width, self.height, self.total_mine = int( width_input.get()), int(height_input.get()), int( bomb_amount_input.get()) custom_prompt.destroy() self.cleanup(difficulty=3) #initialize the prompt window (I used a themed window so it looks better) custom_prompt = ThemedTk(theme='breeze') custom_prompt.geometry('265x166') custom_prompt.title('Custom') custom_prompt.focus_force() #initialize all the widget inside the window height_label = ttk.Label(custom_prompt, text='Height:') width_label = ttk.Label(custom_prompt, text='Width:') bomb_amount_label = ttk.Label(custom_prompt, text='Mines:') width_input = ttk.Spinbox(custom_prompt, width=5, from_=9, to=24) height_input = ttk.Spinbox(custom_prompt, width=5, from_=9, to=30) bomb_amount_input = ttk.Spinbox(custom_prompt, width=5, from_=9, to=99) ok_button = ttk.Button(custom_prompt, text='OK', command=return_custom) cancel_button = ttk.Button(custom_prompt, text='Cancel', command=custom_prompt.destroy) #place them one by one inside the window (grid system will perform better here (because I don't need to calculate x and y lol)) height_label.grid(row=0, column=0, padx=15, pady=(30, 0)) width_label.grid(row=1, column=0, padx=15, pady=(5, 0)) bomb_amount_label.grid(row=2, column=0, padx=15, pady=(5, 0)) height_input.grid(row=0, column=1, padx=15, pady=(30, 0)) width_input.grid(row=1, column=1, padx=15, pady=(5, 0)) bomb_amount_input.grid(row=2, column=1, padx=15, pady=(5, 0)) ok_button.grid(row=0, column=2, pady=(30, 0)) cancel_button.grid(row=2, column=2, pady=(5, 0)) #initialize the value in the input box to current value width_input.set(self.width) height_input.set(self.height) bomb_amount_input.set(self.total_mine) #show the window up custom_prompt.mainloop()
class MyGUI(object): def __init__(self): # self.root = tk.Tk() self.root = ThemedTk(theme="arc") #<<注释3>> self.root.geometry("450x600+800+200") self.root.title("GIS") #设置程序名称 self.var = tk.StringVar() self.img1 = tk.PhotoImage(file="icon/shp2.gif") self.img2 = tk.PhotoImage(file="icon/ok2.gif") # run function self.create_widget() self.create_run_button() self.root.mainloop() # 执行循环 def create_widget(self): self.frame1 = ttk.Frame(self.root) self.frame1.pack(fill="x") self.entry = ttk.Entry(self.frame1) #<<注释4>> self.entry.config(textvariable=self.var) self.entry.pack(side="left", expand=True, fill="x", pady=8, padx=10) self.but = tk.Button(self.frame1, relief="flat") # self.but = ttk.Button(self.frame1) self.but.config(command=self.open_dialog) self.but.config(image=self.img1) self.but.pack(side="right", pady=8, padx=6) def open_dialog(self): varrr = tkFileDialog.askopenfilename() self.var.set(varrr) def create_run_button(self): # 生成下方的“运行”按钮 self.bottom_frame = ttk.Frame(self.root) self.bottom_frame.pack(side="bottom", fill="x", anchor="s") self.ok_button = tk.Button(self.bottom_frame, relief="flat") # self.ok_button = ttk.Button(self.bottom_frame) self.ok_button.pack(side="right", pady=8, padx=6) self.ok_button.config(image=self.img2) self.ok_button.config(command=self.run_multiprocessing) # def run(self): # giscode.main(self.var.get()) def run_multiprocessing(self): p = Process(target=giscode.main, args=(self.var.get(), )) p.start() print "PID:", p.pid
def start(func, kol, speed, values=None, color_scheme="dracula"): root_main = ThemedTk() root_main.iconbitmap('icon.ico') root_main.title("Vizulization") root_main.set_theme('equilux') height = root_main.winfo_screenheight() - 300 width = root_main.winfo_screenwidth() - 300 root_main.geometry( '{}x{}+{}+{}'.format(width, height, (root_main.winfo_screenwidth() - width) // 2, (root_main.winfo_screenheight() - height) // 2)) root_main.resizable(False, False) if values: kol = len(values) func(width, height, kol, name=root_main, color_scheme=color_scheme, speed=speed, values=values).sort() root_main.mainloop()
def main(): # root = Tk() root = ThemedTk(theme="clearlooks") # root = Tk() # root.style = Style() # #('clam', 'alt', 'default', 'classic') # root.style.theme_use("clam") root.geometry("250x150+2900+300") button = ttk.Button(root, text="Click Me", underline=6) button.pack() # root.configure(bg='red') app = Example() root.mainloop()
def classic_button_function(self): self.exit_button_function() root = ThemedTk(theme=self.THEME) root.title(APPNAME) ws = root.winfo_screenwidth() / 2 hs = root.winfo_screenheight() / 2 root.geometry('%dx%d+%d+%d' % (580, 614, ws - 290, hs - 307)) root.resizable(0, 0) game = PvAI_Game(Board(), Strategies.Minimax(2, Player.BLACK, Player.WHITE), root, width=592, height=618) game.pack(side="top", fill="both", expand="true") game.draw_pieces() root.mainloop()
class FrontEnd: APP_WIDTH = 400 APP_HEIGHT = 450 PROJECT_PATH = os.getcwd() def __init__(self, inputs, main_script): self.root = ThemedTk(theme="equilux") self.root.geometry(f"{self.APP_WIDTH}x{self.APP_HEIGHT}") self.root.resizable(False, False) self.root.title('Gui Scripter') icon = ImageTk.PhotoImage( Image.open(os.path.join(self.PROJECT_PATH, 'static/rob_icon.png'))) self.root.iconphoto(False, icon) self.app_frame = ttk.Frame(self.root, width=self.APP_WIDTH, height=self.APP_HEIGHT) self.app_frame.pack(expand=True, fill='both') main_image = ImageTk.PhotoImage( Image.open(os.path.join(self.PROJECT_PATH, 'static/rob.png'))) panel = tk.Label(self.app_frame, image=main_image, bg='#464646') panel.pack() self.inputs_dict = {} self.label_dict = {} for input_name in inputs: self.inputs_dict[input_name] = ttk.Entry(self.app_frame) self.label_dict[input_name] = ttk.Label(self.app_frame, text=input_name) self.label_dict[input_name].pack(anchor='center') self.inputs_dict[input_name].pack(anchor='center', pady=2) self.run_script_button = ttk.Button(self.app_frame, text="Run !", command=main_script, takefocus=0) self.run_script_button.pack(anchor='center', pady=15) self.progress_bar = ttk.Progressbar(self.app_frame, orient="horizontal", length=self.APP_WIDTH - 100, mode='determinate') self.progress_bar.pack(side='top', padx=0, pady=35, anchor='n') self.root.mainloop()
def vvtl(): nsc=ThemedTk(theme="arc") nsc.title("voter_list") w, h = nsc.winfo_screenwidth(), nsc.winfo_screenheight() nsc.geometry("%dx%d+0+0" % (w, h)) nsc.iconbitmap("gov2.ico") c = sqlite3.connect("voterlist.db", check_same_thread=False) tc = c.execute("SELECT usr,pw,eml,phon,cou,gen,dob,ph,cid,vid,vtsta from voterlist") l=ttk.Label(nsc,text="Name:\t\t\tPassword:\t\tEmail:\t\t\t\tPhone Number:\t\tAddress:\t\t\tGender:\t\tDate of Birth:\t\tCitizenship ID Number:\tVoter ID Number:\t\tVote Status:") l.place(relx=0.01,rely=0.01) i=0.04 for item in tc: l=ttk.Label(nsc,text=str(item[0])+"\t\t"+str(item[1])+"\t\t"+str(item[2])+"\t"+str(item[3])+"\t\t"+str(item[4])+"\t"+str(item[5])+"\t\t"+str(item[6])+"\t\t"+str(item[8])+"\t\t"+str(item[9])+"\t\t"+str(item[10])) l.place(relx=0.01,rely=i) i+=0.02 print(item[0]) nsc.mainloop()
def show_login_window(self): root = ThemedTk(theme=self.STYLE) root.geometry("400x250") root.title('Login') root.resizable(0,0) # title ttk.Label(root, font=('default', 19, 'bold'), text='*******Moriarity Point******').grid(row=0, column=0, sticky='w', padx=15) ttk.Separator(root, orient='horizontal').grid(row=1, columnspan=2, sticky='ew') # sub title ttk.Label(root, font=('default', 14, 'bold'), text='Admin Login').grid(row=2, column=0, sticky='w', padx=5, pady=10) def show_signup(): root.destroy() self.show_signup_window() def login_db(): conn = sqlite3.connect('user.db') p=var_user.get() query =conn.execute("SELECT password FROM user_accounts WHERE name='"+p+"'") for row in query: id= row[0] if id==int(var_pass.get()): m=messagebox.askyesno('Success!', 'User logged in! Continue to make your orders') if m>0: root.destroy() import restaurantmangement else: messagebox.showerror('Error!', 'Username or password does not match!') PADX,PADY=5,5 # login form ttk.Label(root, text='Username:'******'w', padx=PADX, pady=PADY) ttk.Label(root, text='Password:'******'w', padx=PADX, pady=PADY) var_user, var_pass = StringVar(), StringVar() ttk.Entry(root, textvariable=var_user, width=25).grid(row=3, column=0, sticky='e', padx=PADX, pady=PADY) ttk.Entry(root, textvariable=var_pass, width=25).grid(row=4, column=0, sticky='e', padx=PADX, pady=PADY) ttk.Button(root, text='Signup', command=show_signup).grid(row=5, column=0, sticky='w', padx=PADX, pady=PADY) ttk.Button(root, text='Login', command=login_db).grid(row=5, column=0, sticky='e', padx=PADX, pady=PADY) root.mainloop()
class MainPage(MainpageView): def __init__(self): """Window with main frame""" self.mainpage = ThemedTk() screen_width = self.mainpage.winfo_screenwidth() screen_height = self.mainpage.winfo_screenheight() self.mainpage.geometry(f'+{screen_width//4}+{screen_height//4}') self.mainpage.resizable(0, 0) self.mainframe = ttk.LabelFrame(self.mainpage) self.mainframe.pack(fill=tk.BOTH, expand=1) #Notebook self.notebook = ttk.Notebook(self.mainframe) self.notebook.pack(side='left', anchor=tk.N) def add_notebooks(self): """For adding notebooks""" #Adding record frame self.frame_add = ttk.Frame(self.mainframe) self.notebook.add(self.frame_add, text='Add record') super().add_Frame() #Searching record frame self.frame_search = ttk.Frame(self.mainframe) self.notebook.add(self.frame_search, text='Search record') super().search_Frame() #Editing record frame self.frame_edit = ttk.Frame(self.mainframe) self.notebook.add(self.frame_edit, text='Edit record') super().edit_Frame() #Deleting record frame self.frame_delete = ttk.Frame(self.mainframe) self.notebook.add(self.frame_delete, text='Delete record') super().delete_Frame() #Setting theme frame self.frame_theme = ttk.Frame(self.mainframe) self.notebook.add(self.frame_theme, text='Select theme') super().theme_Frame()
def show_record(self): #initialize the prompt window (I used a themed window so it looks better) record_win = ThemedTk(theme='breeze') record_win.title('Game Record') record_win.geometry('292x106') record_win.focus_force() beginner_label = Label(record_win, text='Beginner:') intermidiate_label = Label(record_win, text='Intermidiate:') expert_label = Label(record_win, text='Expert:') beginner_best = Label(record_win, text='{} seconds'.format(self.record[0][0])) intermidiate_best = Label(record_win, text='{} seconds'.format(self.record[1][0])) expert_best = Label(record_win, text='{} seconds'.format(self.record[2][0])) beginner_name = Label(record_win, text=self.record[0][1]) intermidiate_name = Label(record_win, text=self.record[1][1]) expert_name = Label(record_win, text=self.record[2][1]) beginner_label.grid(row=0, column=0, padx=15, pady=(20, 0), sticky=W) intermidiate_label.grid(row=1, column=0, padx=15, sticky=W) expert_label.grid(row=2, column=0, padx=15, sticky=W) beginner_best.grid(row=0, column=1, pady=(20, 0), sticky=W) intermidiate_best.grid(row=1, column=1, sticky=W) expert_best.grid(row=2, column=1, sticky=W) beginner_name.grid(row=0, column=2, pady=(20, 0), padx=(15, 0), sticky=W) intermidiate_name.grid(row=1, column=2, padx=(15, 0), sticky=W) expert_name.grid(row=2, column=2, padx=(15, 0), sticky=W) record_win.update() record_win.mainloop()
def main(): global LARGE_FONT, realpositive, port LARGE_FONT = ("Verdana", 12) x, y = 648, 520 #root = tk.Tk() root = ThemedTk(theme="adapta") realpositive = tk.IntVar() port = tk.StringVar() global startpage, synthesis, darlington, pageThree, transferFunction startpage = tk.Frame(root) synthesis = tk.Frame(root) darlington = tk.Frame(root) pageThree = tk.Frame(root) transferFunction = tk.Frame(root) for frame in (startpage, synthesis, darlington, pageThree, transferFunction): frame.grid(row=0, column=0, sticky='news') StartPage() Synthesisframe() Darlingtonframe() PageThreeframe() TransferFunctionframe() root.update_idletasks() # Update "requested size" from geometry manager a, a0 = str(x), x / 2 b, b0 = str(y), y / 2 root.geometry("+%d+%d" % ((root.winfo_screenwidth() / 2) - a0, (root.winfo_screenheight() / 3) - b0)) root.deiconify() root.resizable(width=False, height=False) menubar = tk.Menu(root) filemenu = tk.Menu(menubar, tearoff=0) filemenu.add_command(label="Tutorial", command=toturial) filemenu.add_command(label="About", command=About) filemenu.add_command(label="Exit", command=root.destroy) menubar.add_cascade(label="MENU", menu=filemenu) root.config(menu=menubar) root.title("LC & RC Filter") root.bind('<Escape>', lambda e: root.destroy()) root.protocol("WM_DELETE_WINDOW", root.iconify) raise_frame(startpage) root.mainloop()
def main(): datos = None if len(sys.argv) > 1: #esto lo usaba para llamar el programa para pruebas con argumentos, no lo vamos a usar. datos = {} datos["semilla"] = int(sys.argv[1]) datos["constante"] = int(sys.argv[2]) datos["multiplicador"] = int(sys.argv[3]) datos["modulo"] = int(sys.argv[4]) datos["tamano"] = int(sys.argv[5]) #root = Tk() #el holder de la gui root = ThemedTk(theme='clearlooks') root.geometry("690x405") # tamanio de la ventana #poner icono icono = utils.to_dir_file_local('interfaz', 'icono.png') img = PhotoImage(file=icono) root.iconphoto(False, img) app = Ventana(root) # ventana es una clase en el folder interfaz, estoy haciendo una instancia. root.mainloop() # correr la gui
from tkinter import * import tkinter.ttk as ttk from ttkthemes import ThemedTk from pygame import mixer mixer.init() mixer.music.load('/home/arun/Music/Bgmusic (online-audio-converter.com).wav') def play_song(): mixer.music.play() def stop_song(): mixer.music.stop() def pause(): mixer.music.pause() def resume(): mixer.music.unpause() window = ThemedTk(theme="equilux") window.geometry('300x300') # set dimension of the window window.title('Music Player') playButton = ttk.Button(window,text="Play",command=play_song).grid(column=0,row=1) stopButton =ttk. Button(window,text="Stop",command=stop_song).grid(column=1,row=1) pausebutton=ttk.Button(window,text="Pause",command=pause).grid(column=2,row=1) resbutton=ttk.Button(window,text="Resume",command=resume).grid(column=1,row=2) window.mainloop()
self.btnfrm[2].place(x=960, y=150, width=304, height=64, anchor='center') self.btnfrm[3].place(x=1163, y=118, width=304, height=64) self.btnfrm[4].place(x=1822, y=118, width=304, height=64, anchor='ne') root.bind('<Enter>', self.button_on_enter) root.bind('<Leave>', self.button_on_leave) #will be useful in the future ''' distribution_of_cases = distribution_of_cases(root) distribution_of_cases.place(x=0, y=0, width=1200, height=700) ''' root = ThemedTk(theme='breeze') root.geometry('1920x1080') root.config(bg='#191919') root.title('Covid-19 Data Analysis') root.state('zoomed') app = main() app.widget() root.mainloop() quit()
from tkinter import * from tkinter import filedialog from tkinter import messagebox from PIL import Image from tkinter import ttk from ttkthemes import ThemedTk import tkinter.font as tkFont #root= ThemedTk(theme="scid themes") #root= ThemedTk(theme="radiance") #root= ThemedTk(theme="elegance") #root= ThemedTk(theme="clearlooks") #root= ThemedTk(theme="breeze") root= ThemedTk(theme="aquativo") root.geometry('400x300+400+230') root.title('File Conversion Tool') count = 0 sliderwords = '' def labelslider(): global count, sliderwords text= 'File Conversion Tool' if(count >= len(text)): count = 0 sliderwords = '' sliderwords += text[count] count += 1 label1.configure(text = sliderwords) label1.after(150, labelslider)
def menuPage(self): self.clearFrame() try: mainWin.unbind('<Return>',self.bind_id) except TclError: pass self.signUpButton = ttk.Button(self.mainFrame, text='Sign Up', style='TButton', command=self.signUpPage, width=15) self.signUpButton.grid(row=1, column=1, padx=5, pady=5, sticky=W+E+N+S) self.loginButton = ttk.Button(self.mainFrame, text='Log in', style='TButton', command=self.loginPage, width=15) self.loginButton.grid(row=2, column=1, padx=5, pady=5, sticky=W+E+N+S) self.adminButton = ttk.Button(self.mainFrame, text='Admin Mode', style='TButton', command=lambda:[self.admin(), self.loginPage()], width=15) self.adminButton.grid(row=3, column=1, padx=5, pady=5, sticky=W+E+N+S) self.quit = ttk.Button(self.mainFrame, text='Quit', style='S.TButton', command=self.destroy, width=4) self.quit.grid(row=4, column=1, padx=5, pady=20, sticky=N+S) self.lSpace = ttk.Label(self.mainFrame, width=8) self.lSpace.grid(row=0, column=0, pady=35) self.rSpace = ttk.Label(self.mainFrame, width=1) self.rSpace.grid(row=5, column=3, pady=0) mainWin = ThemedTk(theme='arc') mainWin.resizable(False,False) mainWin.geometry('500x500+200+150') atm(mainWin) mainWin.mainloop()
# pip install ttktheme # Tuesday, July 19, 2020 # By RΨST-4M 🚀 # EightSoft Academy from tkinter import * from tkinter import messagebox from tkinter import ttk # Normal Tkinter.* widgets are not themed! from ttkthemes import ThemedTk root = ThemedTk(theme="breeze") root.title("Menu Bar") root.iconbitmap('examples/photos/icon.ico') root.geometry("400x400") # Crate a Menu my_menu = Menu(root) root.config(menu=my_menu) # Create a functions for commands def command_new(): """When you press File->New ... the following function code will work""" ttk.Label(root, text="You Clicked New ...").pack() def command_cut(): ttk.Label(root, text="Awesome, it is working!").pack() def question():
from tkinter import * from tkinter import ttk from tkinter import messagebox as msg from tooltips_2 import CreateToolTip from ttkthemes import ThemedTk, THEMES from PIL import Image from pytesseract import pytesseract import os root = ThemedTk(themebg=True) root.set_theme('plastik') root.title('Extract text from image') root.iconbitmap('D:/python_dars/coding.ico') root.geometry('500x300+300+200') root.resizable(False, False) path_to_tesseract = r"C:\Program Files\Tesseract-OCR\tesseract.exe" def limitsize(*args): length = len(kirit.get()) ga = kirit.index(INSERT) if length > 100: ending = kirit.index(END) if length > 100 and ga != ending: msg.showwarning( 'Ogohlantirish', 'Buncha ko\'p nomli faylning manzili bo\'lmaydi!Iltimos qisqa faylning manzilini kiriting@' ) ga_1 = kirit.index(INSERT) kirit.delete(ga_1, ga_1 + 1)
#window.mainloop() #window = tk.Tk() style = "clam" style = "black" style = "alt" style = "breeze" #style = "blue" #style = "equilux" style = "default" #style = "aqua" window = ThemedTk(theme=style) info = "Account Data {}".format(DDATE) window.title(info) window.geometry('300x300') frame_a = ttk.Frame() frame_b = ttk.Frame() frame_c = ttk.Frame() TEXT = """Total value of account is €{} Realised value is €{} Diviend recieved is €{}""".format(DTOTAL, DREAL, DDIV) ttk.Label(master=frame_a, text=TEXT).grid(column=0, row=0) TEXT = """Stock value is €{} Stock investment is €{} Stock value increase is {}%""".format(DVAL, DINV, DPER) ttk.Label(master=frame_b, text=TEXT).pack()
import tkinter.ttk as ttk from ttkthemes import ThemedTk from tkinter import messagebox import pyshorteners import webbrowser def logic(): s = pyshorteners.Shortener() a = s.tinyurl.short("https://shivamraj.herokuapp.com/") messagebox.showinfo("This is your URL", a) def callback(): url = "www.google.com" webbrowser.open_new(url) top = ThemedTk(theme="scidgrey") top.title("AK url shortner") top.geometry("500x500") filename = PhotoImage(file="A:\Edits\Link.png") background_label = Label(top, image=filename) background_label.place(x=0, y=0, relwidth=1, relheight=1) b1 = ttk.Button(top, text="Click to the open the Link", command=callback).pack() b2 = ttk.Button(top, text="Click to shorten the Url", command=logic).pack() top.mainloop()
from tkinter import * from tkinter.ttk import * from tkinter import messagebox from data import total_status_by_country, total_status_by_country_excel, getCountries, just_global_excel, just_global from ttkthemes import ThemedTk window = ThemedTk(theme='arc') window.title("Covid19") window.geometry('640x420') combo = Combobox(window, state="readonly", values=getCountries(), width=36) combo.current(0) combo.place(x=200, y=25) def country(): if total_status_by_country_excel(combo.get(), combo.get()): total_status_by_country_excel(combo.get(), combo.get()) else: messagebox.showinfo('Hata', 'Veri bulunamadı') def global_data(): just_global_excel() def cond(): if (combo.get() == "Global"): global_data() else: country()
from tkinter import ttk from ttkthemes import ThemedTk root = ThemedTk(theme='radiance') root.geometry('400x300') ttk.Button(root, text='Button').pack(pady=10) ttk.Entry(root).pack() root.mainloop()