diff --git a/front.py b/front.py index dcb84b3..eed2f23 100644 --- a/front.py +++ b/front.py @@ -11,6 +11,7 @@ window.resizable(width=False, height=False) window.configure(background="#ccc") ttk.Style().configure("TCheckbutton", padding=6, relief="flat", background="#ccc") +ttk.Style().configure("TEntry", relief="flat") window.title("Passgen by anqude") window.tk.call('wm', 'iconphoto', window._w, PhotoImage(file='./icon.png')) ttk.Style().configure("TButton", padding=6, relief="flat", @@ -34,7 +35,7 @@ def copy_click(event): def handle_click(event): entry.delete(0, END) try: - password=pass_generate(Checkvariables(),counter) + password=pass_generate(Checkvariables(),int(label2.get())) entry.insert(0, password) except: entry.insert(0, "") @@ -45,15 +46,19 @@ def genadiy(event): def plus_click(event): global counter + counter=int(label2.get()) counter+=1 - label2.config(text=counter) + label2.delete(0, END) + label2.insert(0, counter) def minus_click(event): global counter + counter=int(label2.get()) if counter==1: pass else: counter-=1 - label2.config(text=counter) + label2.delete(0, END) + label2.insert(0, counter) def Checkvariables(): password_lst=alph_generate(Chnumber.get(),ChletterB.get(),ChletterS.get(),Chspec.get()) @@ -67,7 +72,7 @@ Chnumber = IntVar() button.bind("", handle_click) genqr.bind("", genadiy) -entry = Entry(width = 40) +entry = ttk.Entry(width = 40) CheckCpec = Checkbutton(text='Special',variable=Chspec, onvalue=True, offvalue=False, command=Checkvariables,background='#ccc') CheckLetterB = Checkbutton(text='LETTERS',variable=ChletterB, onvalue=True, offvalue=False, command=Checkvariables,background='#ccc') CheckLetterS = Checkbutton(text='Letters',variable=ChletterS, onvalue=True, offvalue=False, command=Checkvariables,background='#ccc') @@ -80,8 +85,8 @@ minus = ttk.Button(text="-") minus.bind("", minus_click) Copy = ttk.Button(text="Copy!",width = 39) Copy.bind("", copy_click) -label2 = Label(text=counter) -label2.configure(background="#ccc") +label2 = ttk.Entry(width = 4) +label2.insert(0, counter) label.pack(anchor="nw") @@ -93,7 +98,7 @@ CheckCpec.place(x=12, y=110) CheckLetterB.place(x=92, y=110) CheckLetterS.place(x=182, y=110) CheckNumber.place(x=262, y=110) -label2.place(x=172, y=150) +label2.place(x=157, y=150) minus.place(x=12, y=140) plus.place(x=252, y=140) Copy.place(x=12, y=190)