Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- from tkinter import *
- def StartMove(self, event):
- try:
- self.TKroot.x = event.x
- self.TKroot.y = event.y
- except:
- pass
- def StopMove(self, event):
- try:
- self.TKroot.x = None
- self.TKroot.y = None
- except:
- pass
- def OnMotion(self, event):
- try:
- deltax = event.x - self.TKroot.x
- deltay = event.y - self.TKroot.y
- x = self.TKroot.winfo_x() + deltax
- y = self.TKroot.winfo_y() + deltay
- self.TKroot.geometry("+%s+%s" % (x, y))
- except:
- pass
- class MainMenu(tk.Frame):
- def __init__(self, master = None):
- tk.Frame.__init__(self, master)
- self.page_main_settings()
- self.FrameWindowTop()
- #self.MainMenu_Code()
- def page_main_settings(self):
- self.master.geometry("900x600+400+200") # W x H
- self.master.resizable(height = True, width = True)
- self.master.title("Main Menu")
- self.master.protocol("WM_DELETE_WINDOW", lambda:self.master.withdraw())
- self.master.attributes('-topmost', True)
- self.master.configure(background = 'darkblue')
- self.master.overrideredirect(1)
- def FrameWindowTop(self):
- def mainmenu_trigger():
- Trigger_Codes(request = 'MainMenuRequest')
- def accountmenu_trigger():
- Trigger_Codes(request = 'AccountMenuRequest')
- topframe = tk.Frame(self.master, width = 150, bg = 'white', height = 50, relief = 'sunken', borderwidth = 2)
- topframe.configure(bg = 'black')
- topframe.pack(expand = True, fill = 'x', anchor = 'n')
- button_main_page = tk.Button(topframe, text = "Main Menu", command = mainmenu_trigger)
- button_main_page.configure(bg = 'black', fg = 'white', font =('Times', 15, 'bold'), borderwidth = 0)
- button_main_page.place(x = 0, y = 0)
- button_main_page_account = Button(topframe, text = 'Account', command = accountmenu_trigger)
- button_main_page_account.configure(bg = 'black', fg = 'white', font =('Times', 15, 'bold'), borderwidth = 0)
- button_main_page_account.place(x = 120, y = 0)
- button_main_page_exit = Button(topframe, text = 'X', command = lambda:self.master.destroy())
- button_main_page_exit.configure(bg = 'black', fg = 'white', font =('Times', 18, 'bold'), borderwidth = 0)
- button_main_page_exit.place(x = 860, y = 0, width = 40)
- button_main_page_withdraw = Button(topframe, text = '_', command = lambda:self.master.withdraw())
- button_main_page_withdraw.configure(bg = 'black', fg = 'white', font =('Times', 15, 'bold'), borderwidth = 0)
- button_main_page_withdraw.place(x = 800, y = 0, width = 40)
- request = None
- class Trigger_Codes():
- def __init__(self, request):
- self.request = request
- self.trigger_menus(request)
- def trigger_menus(self, request):
- if request == 'MainMenuRequest':
- self.MainMenu_Code()
- if request == 'AccountMenuRequest':
- self.AccountMenu_Code()
- def AccountMenu_Code(self):
- global main_label_account,running_status,running_acc_status
- if running_status == True:
- print ("Running")
- main_label.lower()
- account_label.lower()
- password_label.lower()
- website_label.lower()
- note_label.lower()
- main_label_account = Label(main_gui, text = 'Account Settings')
- main_label_account.configure(bg = 'darkblue', fg = 'white', font=('Times', 20, 'underline', 'bold'))
- main_label_account.place(x = 0, y = 50, width = 900)
- running_acc_status = True
- running_status = False
- def MainMenu_Code(self):
- global running_status,main_label, account_label,password_label,website_label,note_label
- try:
- if running_status == False:
- main_label_account.lower()
- try:
- main_label.lift()
- account_label.lift()
- password_label.lift()
- website_label.lift()
- note_label.lift()
- except:
- pass
- except:
- pass
- main_label = Label(main_gui, text = "Password Manager Stored Passwords")
- main_label.configure(bg = 'darkblue', fg = 'white', font=('Times', 20, 'underline', 'bold'))
- main_label.place(x = 0, y = 50, width = 900)
- account_label = Label(main_gui, text = "Accounts")
- password_label = Label(main_gui, text = "Passwords")
- website_label = Label(main_gui, text = "Website")
- note_label = Label(main_gui, text = "Note")
- account_label.configure(bg = 'darkblue', fg = 'white', font=('Times', 20, 'underline', 'bold'))
- password_label.configure(bg = 'darkblue', fg = 'white', font=('Times', 20, 'underline', 'bold'))
- website_label.configure(bg = 'darkblue', fg = 'white', font=('Times', 20, 'underline', 'bold'))
- note_label.configure(bg = 'darkblue', fg = 'white', font=('Times', 20, 'underline', 'bold'))
- account_label.place(x = 0, y = 100, width = 120)
- password_label.place(x = 200, y = 100, width = 120)
- website_label.place(x = 400, y = 100, width = 120)
- note_label.place(x = 600, y = 100, width = 120)
- running_status = True
- main_gui = tk.Toplevel()
- Trigger_Codes(request = 'MainMenuRequest')
- main_app = MainMenu(master = main_gui)
- main_gui.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement