def test_custom_theme(self): if not self.tk.png_support: return for theme in self.tk.pixmap_themes: tk = ThemedTk() tk.set_theme_advanced(theme, brightness=0.2, saturation=1.4, hue=1.8) tk.destroy() return
def set_config(rss_url, telegram_bot, tk): config = configparser.ConfigParser() config['TELEGRAM'] = { 'bot_token': telegram_bot.get() } config['RSS'] = { 'URL': rss_url.get() } with open('settings.ini', 'w') as configfile: config.write(configfile) tk.destroy()
def check(buttons): global click if buttons["text"] == " " and click == True: buttons["text"] = "X" click = False elif buttons["text"] == " " and click == False: buttons["text"] = "O" click = True if ((button1["text"] == "X" and button2["text"] == "X" and button3["text"] == "X") or (button4["text"] == "X" and button5["text"] == "X" and button6["text"] == "X") or (button7["text"] == "X" and button8["text"] == "X" and button9["text"] == "X") or (button3["text"] == "X" and button5["text"] == "X" and button7["text"] == "X") or (button1["text"] == "X" and button5["text"] == "X" and button9["text"] == "X") or (button1["text"] == "X" and button4["text"] == "X" and button7["text"] == "X") or (button2["text"] == "X" and button5["text"] == "X" and button8["text"] == "X") or (button3["text"] == "X" and button6["text"] == "X" and button9["text"] == "X")): tkinter.messagebox.showinfo("winner is X") tk.destroy() elif ((button1["text"] == "O" and button2["text"] == "O" and button3["text"] == "O") or (button4["text"] == "O" and button5["text"] == "O" and button6["text"] == "O") or (button7["text"] == "O" and button8["text"] == "O" and button9["text"] == "O") or (button3["text"] == "O" and button5["text"] == "O" and button7["text"] == "O") or (button1["text"] == "O" and button5["text"] == "O" and button9["text"] == "O") or (button1["text"] == "O" and button4["text"] == "O" and button7["text"] == "O") or (button2["text"] == "O" and button5["text"] == "O" and button8["text"] == "O") or (button3["text"] == "O" and button6["text"] == "O" and button9["text"] == "O")): tkinter.messagebox.showinfo("winner is O") tk.destroy() elif (button1["text"] != " " and button2["text"] != " " and button3["text"] != " " and button4["text"] != " " and button5["text"] != " " and button6["text"] != " " and button7["text"] != " " and button8["text"] != " " and button9["text"] != " "): tkinter.messagebox.showinfo("match tie") tk.destroy()
def run_leave(): tk.destroy()
def signin(): print("200") tk.destroy() dashboard()
def quit(): tk.destroy()
def cat(tk): tk.destroy() top = Tk() top.geometry('500x400') top.title("Categories") top['bg']='white' def wait(value): print("Just checkin") print(value) def logout(): print("Logging out") #msg top.destroy() menu = Menu(top, background='lightblue', foreground='black') top.configure(menu = menu) submenu=Menu(menu, background = 'white', foreground = 'black') #creating a submenu menu.add_cascade(label="GROCERIES", menu = submenu) #labeling the submenu #my_conn.execute("select product_name from groceries") #groc=my_conn.fetchall() #print(groc) #debug #print(len(groc)) #item 1 #for i in range(len(groc)): # submenu.add_command(label=groc[i], command=lambda : wait(5)) # submenu.add_separator() import groc_buttons groc_buttons.groc_create(submenu,my_conn, top,my_connect) #print("Val in main= "+str(val)) #include("groc_buttons.py") #submenu.add_command(label="Sugar", command = lambda : wait(5)) #submenu.add_separator() #submenu.add_command(label="Rice", command = lambda : wait(5)) #submenu.add_separator() #submenu.add_command(label="Chilli Powder", command = lambda : wait(5)) submenu1=Menu(menu, background = 'white', foreground = 'black') #second submenu menu.add_cascade(label="MILK PRODUCTS", menu = submenu1) #import groc_buttons groc_buttons.mp_create(submenu1,my_conn, top,my_connect) #my_conn.execute("select product_name from milkproducts") #milkp=my_conn.fetchall() #print(milkp) #for i in range(len(milkp)): # submenu2.add_command(label=milkp[i], command=lambda : wait(i)) # print(i) # submenu2.add_separator() #submenu2.add_command(label="Milk", command = lambda : wai #submenu2.add_separator() #submenu2.add_command(label="Milk Powder", command = lambda : wait(5)) #submenu2.add_separator() #submenu2.add_command(label="Curd", command = lambda : wait(5)) submenu2=Menu(menu, background = 'white', foreground = 'black') #third submenu menu.add_cascade(label="FRUITS", menu = submenu2) groc_buttons.fruit_create(submenu2,my_conn, top,my_connect) #my_conn.execute("select product_name from fruits") #fruit=my_conn.fetchall() #print(fruit) #debug = db ;) #for i in range(len(fruit)): # submenu3.add_command(label=fruit[i], command=lambda : wait(5)) # submenu3.add_separator() #submenu3.add_command(label="Mango", command = lambda : wait(5)) #submenu3.add_separator() #submenu3.add_command(label="Grapes", command = lambda : wait(5)) #submenu3.add_separator() #submenu3.add_command(label="Apple", command = lambda : wait(5)) #submenu3.add_separator() #submenu3.add_command(label="Pineapple", command = lambda : wait(5)) #submenu3.add_separator() #submenu3.add_command(label="Lichi", command = lambda : wait(5)) submenu3=Menu(menu, background = 'white', foreground = 'black') #fourth submenu menu.add_cascade(label="VEGETABLES", menu = submenu3) groc_buttons.veggie_create(submenu3,my_conn, top, my_connect) #my_conn.execute("select product_name from vegetables") #veggie=my_conn.fetchall() #print(veggie) #debug = db ;) #for i in range(len(veggie)): # submenu4.add_command(label=veggie[i], command=lambda : wait(5)) # submenu4.add_separator() #submenu4.add_command(label="Carrot", command = lambda : wait(5)) #submenu4.add_separator() #submenu4.add_command(label="Raddish", command = lambda : wait(5)) #submenu4.add_separator() #submenu4.add_command(label="Potato", command = lambda : wait(5)) #submenu4.add_separator() #submenu4.add_command(label="Onion", command = lambda : wait(5)) #submenu4.add_separator() #submenu4.add_command(label="Pumpkin", command = lambda : wait(5)) submenu4=Menu(menu, background = 'white', foreground = 'black') #fifth submenu menu.add_cascade(label="HEALTH CARE", menu = submenu4) groc_buttons.hc_create(submenu4, my_conn, top, my_connect) #my_conn.execute("select product_name from healthcare") #hc=my_conn.fetchall() #print(hc) #db #for i in range(len(hc)): # submenu5.add_command(label=hc[i], command=lambda : wait(5)) # submenu5.add_separator() #submenu5.add_command(label="Mask", command = lambda : wait(5)) #submenu5.add_separator() #submenu5.add_command(label="Sanitiser", command = lambda : wait(5)) #submenu5.add_separator() #submenu5.add_command(label="Disinfectant", command = lambda : wait(5)) #submenu5.add_separator() #submenu5.add_command(label="Face shield", command = lambda : wait(5)) #submenu5.add_separator() #submenu5.add_command(label="Gloves", command = lambda : wait(5)) logoutbutton=Button(top, text='Logout', command=logout, background='gray', foreground='white') logoutbutton.place(relx=1, rely=0.0, anchor="ne")
def close(): tk.destroy()
def close_window(): tkr.destroy()