def __init__(self, dataQueue): self.dataQueue = dataQueue self.root = Tk() self.root.title('Dice Framework') # Set window title and size self.work_tokens = [] self.mastertoken = [] self.masterloggedin = False self.kill_army = False self.bet_tick = 0 self.master_balance = "0.00000000" self.balance = "0.00000000" #Start HTTP session self.session = requests.Session() #HTTP Headers self.headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/43.0.2357.130 Chrome/43.0.2357.130 Safari/537.36'} #Loading Images self.overview_bg = ImageTk.PhotoImage(file = './images/super_mario_by_xxlightsourcexx.jpg') self.imageoptionlib = ImageTk.PhotoImage(file = './images/options.jpg') self.calcimg = ImageTk.PhotoImage(file = './images/40833_super_mario_bros_bowser.jpg') self.imageloglib = ImageTk.PhotoImage(file = './images/snes.png') # Master container self.window = Frame(self.root, bg = 'black') # Root => Header self.frame_header = Frame(self.window, bg = "black") # Clock Box self.clocklblFrame = LabelFrame(self.frame_header, text = "Current Time:", font = ('Helvectica', 13, 'bold'), labelanchor = 'nw', bd = 3, bg = "black", fg = "white") self.clocklbl = Label(self.clocklblFrame, font = ('Helvectica', 16, 'bold'), bg = "#000000", fg = "#FFFFFF") # Wagered Box self.totalWageredFrame = LabelFrame(self.frame_header, text = "Total Wagered:", font = ('Helvectica', 13, 'bold'), labelanchor = 'nw', bd = 3, bg = "black", fg = "#8888FF") self.totalWageredlbl = Label(self.totalWageredFrame, text = str(self.balance), font = ('Impact', 15, 'bold'), bg = "#000000", fg = "#FFFFFF", width = 20) # Affiliate Box self.affiliateFrame = LabelFrame(self.frame_header, text = "Affiliate Balance:", font = ('Helvectica', 13, 'bold'), labelanchor = 'nw', bd = 3, bg = "black", fg = "#8888FF") self.affiliatelbl = Label(self.affiliateFrame, text = '0', font = ('Impact', 15, 'bold'), bg = "#000000", fg = "#00FF00") # Bet Count Box self.betcountFrame = LabelFrame(self.frame_header, text = "Bet Counter:", font = ('Helvectica', 13, 'bold'), labelanchor = 'nw', bd = 3, bg = "black", fg = "#8888FF") self.betcountlbl = Label(self.betcountFrame, text = "0", font = ('Impact', 15, 'bold'), bg = "#000000", fg = "#FFFFFF") # Mouse Debug Box self.mousedebugFrame = LabelFrame(self.frame_header, text = "[Dev] Mouse:", font = ('Helvectica', 10, 'bold'), labelanchor = 'nw', bd = 3, bg = "black", fg = "#8888FF", width = 30) self.mousedebugLblX = Label(self.mousedebugFrame, text = "X: -", font = ('Helvectica', 9, 'bold'), bg = "#00000F", fg = "#00FFFF") self.mousedebugLblY = Label(self.mousedebugFrame, text = "Y: -", font = ('Helvectica', 9, 'bold'), bg = "#00000F", fg = "#FF00FF") self.frame_header.pack(side = "top", fill = 'both', padx = 290) self.clocklblFrame.pack(side = 'left') self.clocklbl.pack() self.totalWageredFrame.pack(side = 'left') self.totalWageredlbl.pack() self.affiliateFrame.pack(side = 'left') self.affiliatelbl.pack() self.betcountFrame.pack(side = 'left') self.betcountlbl.pack() self.mousedebugFrame.pack(side = 'left', padx = 30) self.mousedebugLblX.pack(side = 'right') self.mousedebugLblY.pack(side = 'left') # Body self.notebook = ttk.Notebook(self.window, height = 920, width = 1360) tab_style = ttk.Style() tab_style.configure("TNotebook", background = "black", borderwidth = 0) # Body -> Overview Tab self.overview = ttk.Frame(self.notebook, style = 'Tab1.TFrame') self.imagelbl = Label(self.overview, image = self.overview_bg).place(relx = 0, rely = 0, y = 0, relwidth = 1, relheight = 1) # Overview Tab -> Master self.master_bot = LabelFrame(self.overview, width = 130, height = 50, text = "Main Account", bg = '#DCF4FF', font = ('Digital-7', 10)) self.boxy = Frame(self.master_bot, bg = '#DCF4FF') self.login_master = Button(self.boxy, text = "Login", fg = "#a1dbcd", bg = "#383a39", width = 10, command = lambda: self.login_box()) self.logout_master = Button(self.boxy, text = "Create User", fg = "#a1dbcd", bg = "#383a39", width = 10, command = lambda: self.signup_box()) self.masteruser = Label(self.boxy, fg = "#7733FF", text = "", bg = "#DCF4FF", width = 10) #self.si_master = Button(self.boxy, text = "Create User", fg = "#a1dbcd", bg = "#383a39", width = 10, command = lambda: self.signup_box(master = True)) self.boxxy = Frame(self.master_bot, bg = '#DCF4FF') self.master_balance_lbl = Label(self.boxxy, text = "Balance", fg = "#7733FF", bg = '#DCF4FF', font = ('Times', 13, 'bold')) self.master_balance_lbl1 = Label(self.boxxy, text = str(self.balance), fg = "#7777FF", bg = '#DCF1FF', width = 10, font = ('Aerial', 14, 'bold')) self.boxxxy = Frame(self.master_bot, bg = '#DCF4FF') self.predictionlbl = Label(self.boxxxy, text = "Prediction:", fg = "#7733FF", bg = '#DCF4FF', width = 10, font = ('Times', 13, 'bold', 'italic')) self.predictionent = Entry(self.boxxxy, fg = "#7777FF", bg = '#DCF4FF', width = 5) self.predictionent.insert('end', "49.95") self.amountlbl = Label(self.boxxxy, text = " Bet Amount:", fg = "#7733FF", bg = '#DCF4FF', width = 10, font = ('Times', 13, 'bold', 'italic')) self.amountent = Entry(self.boxxxy, fg = "#7777FF", bg = '#DCF4FF', width = 5) self.amountent.insert('end', "0") self.boxxxxy = LabelFrame(self.master_bot, bg = '#DCF4FF', text = 'Bet:', bd = 1, fg = "#7722FF", font = ('Times', 13, 'bold', 'italic')) self.hi = Button(self.boxxxxy, text = "Hi", fg = "#FFFFFF", bg = "#7777FF", font = ('Helvectica', 10, 'bold'), width = 10, command = lambda amount = self.amountent.get(), target = self.predictionent.get(): self.bet(condition = "<", target = target, amount = amount)) self.lo = Button(self.boxxxxy, text = "Lo", fg = "#FFFFFF", bg = "#7777FF", font = ('Helvectica', 10, 'bold'), width = 10, command = lambda amount = self.amountent.get(), target = self.predictionent.get(): self.bet(condition = "<", target = target, amount = amount)) self.logg = LabelFrame(self.overview, bg = '#DCF4FF') self.text = Text(self.logg, height = 10, width = 50) self.text.tag_config('newline', background = 'grey') self.scroller = Scrollbar(self.logg) self.text.config(yscrollcommand = self.scroller.set) # if config.master_token != '': self.master_bot.place(x = 45, y = 5) self.boxy.pack(side = 'left', padx = 15) self.masteruser.pack(pady = 3, ipady = 1) self.login_master.pack() self.logout_master.pack(pady = 3) self.boxxy.pack(side = 'left', padx = 10, pady = 1) self.master_balance_lbl.pack(pady = 2) self.master_balance_lbl1.pack() self.boxxxy.pack(side = 'left', padx = 5, pady = 1) self.predictionlbl.pack() self.predictionent.pack() self.amountlbl.pack(pady = 0) self.amountent.pack(pady = 9) self.boxxxxy.pack(side = 'left', padx = 5, pady = 1) self.hi.pack(side = 'left', padx = 5, pady = 2) self.lo.pack(side = 'right', padx = 5, pady = 2) self.logg.place(x = 700, y = 10) self.text.pack(side = 'left') self.scroller.pack(side = 'left', fill = 'both') # Options Tab self.options = ttk.Frame(self.notebook, style = 'Tab1.TFrame') self.imageoptionlbl = Label(self.options, image = self.imageoptionlib).place(relx = 0, rely = 0, relwidth = 1, relheight = 1) # Calculator Tab self.calc_tab = ttk.Frame(self.notebook, style = 'Tab1.TFrame') self.calclbl = Label(self.calc_tab, image = self.calcimg).place(relx = 0, rely = 0, relwidth = 1, relheight = 1) self.calc1 = Button(self.calc_tab, text = "Loss Streak Probability", fg = "#FF0000", bg = "#F3A60D", command = lambda: self.loss_streak_calc()) self.calc1.place(x = 145, y = 30) self.calc2 = Button(self.calc_tab, text = "% Increase vs Multiplier", fg = "#FF0000", bg = "#F3A60D", command = lambda: self.inc_multi_calc()) self.calc2.place(x = 285, y = 30) # Pack tabs into view self.notebook.add(self.overview, text = "Overview") self.notebook.add(self.options, text = "Options") self.notebook.add(self.calc_tab, text = "Calculators") self.root.state('zoomed') # Window state: Maximized self.root.bind("<Motion>", self.debug_mouse) self.tick() self.poll() self.notebook.pack() self.window.pack(fill = 'both') self.root.mainloop()
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' font9 = "-family {Segoe UI} -size 9 -weight normal -slant " \ "roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("800x580+525+163") top.minsize(800, 600) top.maxsize(3844, 1061) top.resizable(0, 0) top.title("Dashboard") top.configure(background="#d9d9d9") top.configure(highlightbackground="#f0f0f0f0f0f0") top.configure(highlightcolor="black") self.menubar = tk.Menu(top, font=font9, bg=_bgcolor, fg=_fgcolor) top.configure(menu=self.menubar) self.menubar.add_command(activebackground="#ececec", activeforeground="#000000", background="#d9d9d9", command=btsPub_support.tablero, font=('-family {Segoe UI} -size 9'), foreground="#000000", label="Tablero") self.menubar.add_command(activebackground="#ececec", activeforeground="#000000", background="#d9d9d9", command=btsPub_support.campania, font=('-family {Segoe UI} -size 9'), foreground="#000000", label="Campaña") self.menubar.add_command(activebackground="#ececec", activeforeground="#000000", background="#d9d9d9", command=btsPub_support.salir, font=('-family {Segoe UI} -size 9'), foreground="#000000", label="Salir") self.TCombobox1 = ttk.Combobox(top) self.TCombobox1.place(relx=0.4, rely=0.345, relheight=0.036, relwidth=0.179) self.TCombobox1.configure(textvariable=btsPub_support.combobox) self.TCombobox1.configure(takefocus="") self.TCombobox1.configure(cursor="fleur")
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' font9 = "-family {Century751 No2 BT} -size 15 -weight bold " \ "-underline 1" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("510x518+370+114") top.minsize(120, 1) top.maxsize(1370, 749) top.resizable(1, 1) top.title("New Toplevel") top.configure(background="#b6fcfa") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="black") self.Label1 = tk.Label(top) self.Label1.place(relx=0.314, rely=0.019, height=31, width=173) self.Label1.configure(activebackground="#f9f9f9") self.Label1.configure(activeforeground="black") self.Label1.configure(background="#b6fcfa") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure( font="-family {Cooper Black} -size 20 -underline 1") self.Label1.configure(foreground="#000000") self.Label1.configure(highlightbackground="#d9d9d9") self.Label1.configure(highlightcolor="black") self.Label1.configure(text='''My Mall''') self.TFrame1 = ttk.Frame(top) self.TFrame1.place(relx=0.039, rely=0.135, relheight=0.241, relwidth=0.206) self.TFrame1.configure(relief='groove') self.TFrame1.configure(borderwidth="2") self.TFrame1.configure(relief="groove") self.TLabel1 = ttk.Label(self.TFrame1) self.TLabel1.place(relx=0.095, rely=0.368, height=18, width=76) self.TLabel1.configure(background="#d9d9d9") self.TLabel1.configure(foreground="#000000") self.TLabel1.configure(font="TkDefaultFont") self.TLabel1.configure(relief="flat") self.TLabel1.configure(anchor='w') self.TLabel1.configure(justify='left') self.TLabel1.configure(text='''Dell Keyboard''') self.TLabel2 = ttk.Label(self.TFrame1) self.TLabel2.place(relx=0.19, rely=0.52, height=18, width=50) self.TLabel2.configure(background="#d9d9d9") self.TLabel2.configure(foreground="#000000") self.TLabel2.configure(font="TkDefaultFont") self.TLabel2.configure(relief="flat") self.TLabel2.configure(anchor='w') self.TLabel2.configure(justify='left') self.TLabel2.configure(text='''Rs. 500''') self.addcart = ttk.Button(self.TFrame1) self.addcart.place(relx=0.095, rely=0.664, height=25, width=76) self.addcart.configure(takefocus="") self.addcart.configure( text='''Add to Cart''', command=lambda: self.insert_items("Dell Keyboard", 500)) self.Label2 = tk.Label(self.TFrame1) self.Label2.place(relx=0.067, rely=0.072, height=29, width=89) self.Label2.configure(background="#6363eb") self.Label2.configure(disabledforeground="#a3a3a3") self.Label2.configure(foreground="#000000") self.Label2.configure(text='''Dell''') self.TFrame1_1 = ttk.Frame(top) self.TFrame1_1.place(relx=2.39, rely=1.088, relheight=1.0, relwidth=1.0) self.Label2_5 = tk.Label(self.TFrame1_1) self.Label2_5.place(relx=0.067, rely=0.072, height=29, width=79) self.Label2_5.configure(activebackground="#f9f9f9") self.Label2_5.configure(activeforeground="black") self.Label2_5.configure(background="#6363eb") self.Label2_5.configure(disabledforeground="#a3a3a3") self.Label2_5.configure(foreground="#000000") self.Label2_5.configure(highlightbackground="#d9d9d9") self.Label2_5.configure(highlightcolor="black") self.Label2_5.configure(text='''Dell''') self.style.configure('Treeview', font="TkDefaultFont") self.Scrolledtreeview1 = ScrolledTreeView(top) self.Scrolledtreeview1.place(relx=0.078, rely=0.483, relheight=0.284, relwidth=0.824) self.Scrolledtreeview1.configure(columns=("Col1", "Col2", "Col3")) # build_treeview_support starting. self.Scrolledtreeview1.heading("#0", text="Product Name") self.Scrolledtreeview1.heading("#0", anchor="center") self.Scrolledtreeview1.column("#0", width="150") self.Scrolledtreeview1.column("#0", minwidth="20") self.Scrolledtreeview1.column("#0", stretch="1") self.Scrolledtreeview1.column("#0", anchor="center") self.Scrolledtreeview1.heading("Col1", text="Price") self.Scrolledtreeview1.heading("Col1", anchor="center") self.Scrolledtreeview1.column("Col1", width="90") self.Scrolledtreeview1.column("Col1", minwidth="20") self.Scrolledtreeview1.column("Col1", stretch="1") self.Scrolledtreeview1.column("Col1", anchor="center") self.Scrolledtreeview1.heading("Col2", text="Quantity") self.Scrolledtreeview1.heading("Col2", anchor="center") self.Scrolledtreeview1.column("Col2", width="70") # self.Scrolledtreeview1.column("Col2", minwidth="20") self.Scrolledtreeview1.column("Col2", stretch="1") self.Scrolledtreeview1.column("Col2", anchor="center") self.Scrolledtreeview1.heading("Col3", text="Amount") self.Scrolledtreeview1.heading("Col3", anchor="center") self.Scrolledtreeview1.column("Col3", width=" 103") # self.Scrolledtreeview1.column("Col3", minwidth="20") self.Scrolledtreeview1.column("Col3", stretch="1") self.Scrolledtreeview1.column("Col3", anchor="center") self.TLabel3 = ttk.Label(top) self.TLabel3.place(relx=0.294, rely=0.405, height=29, width=209) self.TLabel3.configure(background="#b6fcfa") self.TLabel3.configure(foreground="#000000") self.TLabel3.configure(font=font9) self.TLabel3.configure(relief="flat") self.TLabel3.configure(anchor='w') self.TLabel3.configure(justify='left') self.TLabel3.configure(text='''Product Description''') self.delete = ttk.Button(top) self.delete.place(relx=0.078, rely=0.772, height=25, width=140) self.delete.configure(takefocus="") self.delete.configure(text='''Delete''', command=self.delete_data) self.TFrame2 = ttk.Frame(top) self.TFrame2.place(relx=0.275, rely=0.135, relheight=0.241, relwidth=0.206) self.TFrame2.configure(relief='groove') self.TFrame2.configure(borderwidth="2") self.TFrame2.configure(relief="groove") self.TLabel4 = ttk.Label(self.TFrame2) self.TLabel4.place(relx=0.095, rely=0.08, height=29, width=80) self.TLabel4.configure(background="#6363eb") self.TLabel4.configure(foreground="#000000") self.TLabel4.configure(font="TkDefaultFont") self.TLabel4.configure(relief="flat") self.TLabel4.configure(anchor='w') self.TLabel4.configure(justify='left') self.TLabel4.configure(text='''HP''') self.TLabel5 = ttk.Label(self.TFrame2) self.TLabel5.place(relx=0.19, rely=0.32, height=19, width=59) self.TLabel5.configure(background="#d9d9d9") self.TLabel5.configure(foreground="#000000") self.TLabel5.configure(font="TkDefaultFont") self.TLabel5.configure(relief="flat") self.TLabel5.configure(anchor='w') self.TLabel5.configure(justify='left') self.TLabel5.configure(text='''Hp Mouse''') self.TLabel6 = ttk.Label(self.TFrame2) self.TLabel6.place(relx=0.286, rely=0.48, height=19, width=40) self.TLabel6.configure(background="#d9d9d9") self.TLabel6.configure(foreground="#000000") self.TLabel6.configure(font="TkDefaultFont") self.TLabel6.configure(relief="flat") self.TLabel6.configure(anchor='w') self.TLabel6.configure(justify='left') self.TLabel6.configure(text='''Rs. 300''') self.addcart2 = ttk.Button(self.TFrame2) self.addcart2.place(relx=0.095, rely=0.64, height=25, width=76) self.addcart2.configure(takefocus="") self.addcart2.configure( text='''Add to Cart''', command=lambda: self.insert_items("HP Mouse", 300)) self.TFrame3 = ttk.Frame(top) self.TFrame3.place(relx=0.51, rely=0.135, relheight=0.241, relwidth=0.206) self.TFrame3.configure(relief='groove') self.TFrame3.configure(borderwidth="2") self.TFrame3.configure(relief="groove") self.TLabel7 = ttk.Label(self.TFrame3) self.TLabel7.place(relx=0.095, rely=0.08, height=29, width=83) self.TLabel7.configure(background="#6363eb") self.TLabel7.configure(foreground="#000000") self.TLabel7.configure(font="TkDefaultFont") self.TLabel7.configure(relief="flat") self.TLabel7.configure(anchor='w') self.TLabel7.configure(justify='left') self.TLabel7.configure(text='''Lenovo''') self.TLabel9 = ttk.Label(self.TFrame3) self.TLabel9.place(relx=0.095, rely=0.32, height=19, width=86) self.TLabel9.configure(background="#d9d9d9") self.TLabel9.configure(foreground="#000000") self.TLabel9.configure(font="TkDefaultFont") self.TLabel9.configure(relief="flat") self.TLabel9.configure(anchor='w') self.TLabel9.configure(justify='left') self.TLabel9.configure(text='''Lenovo printer''') self.TLabel10 = ttk.Label(self.TFrame3) self.TLabel10.place(relx=0.286, rely=0.48, height=19, width=55) self.TLabel10.configure(background="#d9d9d9") self.TLabel10.configure(foreground="#000000") self.TLabel10.configure(font="TkDefaultFont") self.TLabel10.configure(relief="flat") self.TLabel10.configure(anchor='w') self.TLabel10.configure(justify='left') self.TLabel10.configure(text='''Rs. 7000''') self.addcart3 = ttk.Button(self.TFrame3) self.addcart3.place(relx=0.19, rely=0.64, height=25, width=76) self.addcart3.configure(takefocus="") self.addcart3.configure( text='''Add to Cart''', command=lambda: self.insert_items("Lenovo Printer", 7000)) self.TFrame4 = ttk.Frame(top) self.TFrame4.place(relx=0.745, rely=0.135, relheight=0.241, relwidth=0.206) self.TFrame4.configure(relief='groove') self.TFrame4.configure(borderwidth="2") self.TFrame4.configure(relief="groove") self.TLabel8 = ttk.Label(self.TFrame4) self.TLabel8.place(relx=0.095, rely=0.08, height=29, width=85) self.TLabel8.configure(background="#6363eb") self.TLabel8.configure(foreground="#000000") self.TLabel8.configure(font="TkDefaultFont") self.TLabel8.configure(relief="flat") self.TLabel8.configure(anchor='w') self.TLabel8.configure(justify='left') self.TLabel8.configure(text='''Apple''') self.addcart4 = ttk.Button(self.TFrame4) self.addcart4.place(relx=0.19, rely=0.64, height=25, width=76) self.addcart4.configure(takefocus="") self.addcart4.configure( text='''Add to Cart''', command=lambda: self.insert_items("Apple Mouse", 3500)) self.TLabel12 = ttk.Label(self.TFrame4) self.TLabel12.place(relx=0.286, rely=0.48, height=19, width=46) self.TLabel12.configure(background="#d9d9d9") self.TLabel12.configure(foreground="#000000") self.TLabel12.configure(font="TkDefaultFont") self.TLabel12.configure(relief="flat") self.TLabel12.configure(anchor='w') self.TLabel12.configure(justify='left') self.TLabel12.configure(text='''Rs. 3500''') self.TLabel11 = ttk.Label(self.TFrame4) self.TLabel11.place(relx=0.19, rely=0.32, height=19, width=74) self.TLabel11.configure(background="#d9d9d9") self.TLabel11.configure(foreground="#000000") self.TLabel11.configure(font="TkDefaultFont") self.TLabel11.configure(relief="flat") self.TLabel11.configure(anchor='w') self.TLabel11.configure(justify='left') self.TLabel11.configure(text='''Apple mouse''') self.proceed = ttk.Button(top) self.proceed.place(relx=0.353, rely=0.869, height=35, width=166) self.proceed.configure(takefocus="") self.proceed.configure(text='''proceed''', command=self.proceed_item) self.canOrder = ttk.Button(top) self.canOrder.place(relx=0.647, rely=0.772, height=25, width=126) self.canOrder.configure(takefocus="") self.canOrder.configure(text='''Cancel Order''') self.bill = ttk.Button(top) self.bill.place(relx=0.353, rely=0.772, height=25, width=150) self.bill.configure(takefocus="") self.bill.configure(text='''Total Bill''', command=self.total_bill)
def __init__(self, master=None, year=None, month=None, firstweekday=calendar.MONDAY, locale=None, activebackground='#b1dcfb', activeforeground='black', selectbackground='#003eff', selectforeground='white', command=None, borderwidth=1, relief="solid", on_click_month_button=None): """ WIDGET OPTIONS locale, firstweekday, year, month, selectbackground, selectforeground, activebackground, activeforeground, command, borderwidth, relief, on_click_month_button """ if year is None: year = self.datetime.now().year if month is None: month = self.datetime.now().month self._selected_date = None self._sel_bg = selectbackground self._sel_fg = selectforeground self._act_bg = activebackground self._act_fg = activeforeground self.on_click_month_button = on_click_month_button self._selection_is_visible = False self._command = command ttk.Frame.__init__(self, master, borderwidth=borderwidth, relief=relief) self.bind("<FocusIn>", lambda event:self.event_generate('<<DatePickerFocusIn>>')) self.bind("<FocusOut>", lambda event:self.event_generate('<<DatePickerFocusOut>>')) self._cal = get_calendar(locale, firstweekday) # custom ttk styles style = ttk.Style() style.layout('L.TButton', ( [('Button.focus', {'children': [('Button.leftarrow', None)]})] )) style.layout('R.TButton', ( [('Button.focus', {'children': [('Button.rightarrow', None)]})] )) self._font = tkFont.Font() self._header_var = StringVar() # header frame and its widgets hframe = ttk.Frame(self) lbtn = ttk.Button(hframe, style='L.TButton', command=self._on_press_left_button) lbtn.pack(side=LEFT) self._header = ttk.Label(hframe, width=15, anchor=CENTER, textvariable=self._header_var) self._header.pack(side=LEFT, padx=12) rbtn = ttk.Button(hframe, style='R.TButton', command=self._on_press_right_button) rbtn.pack(side=LEFT) hframe.grid(columnspan=7, pady=4) self._day_labels = {} days_of_the_week = self._cal.formatweekheader(3).split() for i, day_of_the_week in enumerate(days_of_the_week): Tkinter.Label(self, text=day_of_the_week, background='grey90').grid(row=1, column=i, sticky=N+E+W+S) for i in range(6): for j in range(7): self._day_labels[i,j] = label = Tkinter.Label(self, background = "white") label.grid(row=i+2, column=j, sticky=N+E+W+S) label.bind("<Enter>", lambda event: event.widget.configure(background=self._act_bg, foreground=self._act_fg)) label.bind("<Leave>", lambda event: event.widget.configure(background="white")) label.bind("<1>", self._pressed) # adjust its columns width font = tkFont.Font() maxwidth = max(font.measure(text) for text in days_of_the_week) for i in range(7): self.grid_columnconfigure(i, minsize=maxwidth, weight=1) self._year = None self._month = None # insert dates in the currently empty calendar self._build_calendar(year, month)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#d9d9d9' # X11 color: 'gray85' font10 = "-family {Courier New} -size 11 -weight bold -slant " \ "roman -underline 0 -overstrike 0" font9 = "-family {Courier New} -size 11 -weight normal -slant " \ "roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("786x383+645+180") top.title("New Toplevel") top.configure(background="#d9d9d9") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="#000000") self.LoginFrame = Frame(top) self.LoginFrame.place(relx=-0.013, rely=0.0, relheight=1.906, relwidth=1.018) self.LoginFrame.configure(borderwidth="2") self.LoginFrame.configure(background="#db2222") self.LoginFrame.configure(highlightbackground="#d9d9d9") self.LoginFrame.configure(highlightcolor="black") self.LoginFrame.configure(width=800) self.UsernameEntry = ttk.Entry(self.LoginFrame) self.UsernameEntry.place(relx=0.513, rely=0.247, relheight=0.029, relwidth=0.208) self.UsernameEntry.configure(font=font9) self.UsernameEntry.configure(textvariable=register_support.usernameVar) self.UsernameEntry.configure(takefocus="") self.UsernameEntry.configure(cursor="ibeam") self.UsernameLabel = ttk.Label(self.LoginFrame) self.UsernameLabel.place(relx=0.3, rely=0.247, height=19, width=86) self.UsernameLabel.configure(background="#DB2222") self.UsernameLabel.configure(foreground="#FFFFFF") self.UsernameLabel.configure(font=font10) self.UsernameLabel.configure(relief=FLAT) self.UsernameLabel.configure(text='''Username:''') self.PasswordLabel = ttk.Label(self.LoginFrame) self.PasswordLabel.place(relx=0.3, rely=0.288, height=19, width=116) self.PasswordLabel.configure(background="#DB2222") self.PasswordLabel.configure(foreground="#FFFFFF") self.PasswordLabel.configure(font=font10) self.PasswordLabel.configure(relief=FLAT) self.PasswordLabel.configure(justify=CENTER) self.PasswordLabel.configure(text='''Full Name:''') self.PasswordLabel.configure(width=116) self.PasswordEntry = ttk.Entry(self.LoginFrame) self.PasswordEntry.place(relx=0.513, rely=0.288, relheight=0.029, relwidth=0.208) self.PasswordEntry.configure(font=font9) self.PasswordEntry.configure(textvariable=register_support.fullNameVar) self.PasswordEntry.configure(takefocus="") self.PasswordEntry.configure(cursor="ibeam") self.fra40_tLa43 = ttk.Label(self.LoginFrame) self.fra40_tLa43.place(relx=0.25, rely=0.014, height=151, width=416) self.fra40_tLa43.configure(background="#DB2222") self.fra40_tLa43.configure(foreground="#000000") self.fra40_tLa43.configure(font="TkDefaultFont") self.fra40_tLa43.configure(relief=FLAT) self.fra40_tLa43.configure(text='''MadDiceGame''') self.fra40_tLa43.configure(width=416) #self._img2 = PhotoImage(file="ico/logo.png") #self.fra40_tLa43.configure(image=self._img2) self.RegisterButton = Button(self.LoginFrame) self.RegisterButton.place(relx=0.338, rely=0.466, height=24, width=277) self.RegisterButton.configure(activebackground="#600606") self.RegisterButton.configure(activeforeground="white") self.RegisterButton.configure(activeforeground="#000000") self.RegisterButton.configure(background="#ffffff") self.RegisterButton.configure(command=register_support.registerUser) self.RegisterButton.configure(disabledforeground="#ffffff") self.RegisterButton.configure(font=font10) self.RegisterButton.configure(foreground="#db2222") self.RegisterButton.configure(highlightbackground="#ffffff") self.RegisterButton.configure(highlightcolor="black") self.RegisterButton.configure(pady="0") self.RegisterButton.configure(relief=FLAT) self.RegisterButton.configure(text='''Register User''') self.PasswordLabel_1 = ttk.Label(self.LoginFrame) self.PasswordLabel_1.place(relx=0.3, rely=0.329, height=19, width=116) self.PasswordLabel_1.configure(background="#DB2222") self.PasswordLabel_1.configure(foreground="#FFFFFF") self.PasswordLabel_1.configure(font=font10) self.PasswordLabel_1.configure(relief=FLAT) self.PasswordLabel_1.configure(justify=CENTER) self.PasswordLabel_1.configure(text='''Email:''') self.PasswordEntry_2 = ttk.Entry(self.LoginFrame) self.PasswordEntry_2.place(relx=0.513, rely=0.329, relheight=0.029, relwidth=0.208) self.PasswordEntry_2.configure(font=font9) self.PasswordEntry_2.configure(textvariable=register_support.emailVar) self.PasswordEntry_2.configure(takefocus="") self.PasswordEntry_2.configure(cursor="ibeam") self.PasswordLabel_2 = ttk.Label(self.LoginFrame) self.PasswordLabel_2.place(relx=0.3, rely=0.37, height=19, width=116) self.PasswordLabel_2.configure(background="#DB2222") self.PasswordLabel_2.configure(foreground="#FFFFFF") self.PasswordLabel_2.configure(font=font10) self.PasswordLabel_2.configure(relief=FLAT) self.PasswordLabel_2.configure(justify=CENTER) self.PasswordLabel_2.configure(text='''Password:''') self.PasswordEntry_3 = ttk.Entry(self.LoginFrame) self.PasswordEntry_3.place(relx=0.513, rely=0.37, relheight=0.029, relwidth=0.208) self.PasswordEntry_3.configure(font=font9) self.PasswordEntry_3.configure( textvariable=register_support.passwordVar) self.PasswordEntry_3.configure(takefocus="") self.PasswordEntry_3.configure(cursor="ibeam") self.PasswordLabel_3 = ttk.Label(self.LoginFrame) self.PasswordLabel_3.place(relx=0.3, rely=0.411, height=19, width=156) self.PasswordLabel_3.configure(background="#DB2222") self.PasswordLabel_3.configure(foreground="#FFFFFF") self.PasswordLabel_3.configure(font=font10) self.PasswordLabel_3.configure(relief=FLAT) self.PasswordLabel_3.configure(justify=CENTER) self.PasswordLabel_3.configure(text='''Confirm Password:''') self.PasswordLabel_3.configure(width=156) self.PasswordEntry_4 = ttk.Entry(self.LoginFrame) self.PasswordEntry_4.place(relx=0.513, rely=0.411, relheight=0.029, relwidth=0.208) self.PasswordEntry_4.configure(font=font9) self.PasswordEntry_4.configure( textvariable=register_support.confPasswordVar) self.PasswordEntry_4.configure(width=166) self.PasswordEntry_4.configure(takefocus="") self.PasswordEntry_4.configure(cursor="ibeam")
def create_widgets(self): # Create some room around all the internal frames self.window['padx'] = 5 self.window['pady'] = 5 # - - - - - - - - - - - - - - - - - - - - - # Frame frame_label = ttk.Label(self.window, text="Frame") frame_label.grid(row=1, column=1, sticky=tk.W, pady=3) frame1 = ttk.Frame(self.window, relief=tk.RIDGE) frame1.grid(row=2, column=1, sticky=tk.E + tk.W + tk.N + tk.S, padx=30, pady=4) self.create_buttons(frame1, "A", "B", "C") # - - - - - - - - - - - - - - - - - - - - - # LabelFrame labeled_frame_label = ttk.Label(self.window, text="LabelFrame") labeled_frame_label.grid(row=3, column=1, sticky=tk.W, pady=3) frame2 = ttk.LabelFrame(self.window, text="Example label", relief=tk.RIDGE) frame2.grid(row=4, column=1, sticky=tk.E + tk.W + tk.N + tk.S, padx=30, pady=4) self.create_buttons(frame2, "D", "E", "F") # - - - - - - - - - - - - - - - - - - - - - # PanedWindow paned_window_label = ttk.Label(self.window, text="PanedWindow") paned_window_label.grid(row=1, column=2, sticky=tk.W) frame3 = tk.PanedWindow(self.window, orient=tk.HORIZONTAL, bd=1, sashwidth=2, sashpad=0, sashrelief=tk.RAISED, showhandle=True) frame3.grid(row=2, column=2, sticky=tk.E + tk.W, padx=30, pady=4) button1 = ttk.Button(frame3, text="do task G") frame3.add(button1) button2 = ttk.Button(frame3, text="do task H") frame3.add(button2) button3 = ttk.Button(frame3, text="do task I") frame3.add(button3) frame3.sash_place(0, 30, 0) # - - - - - - - - - - - - - - - - - - - - - # Notebook style = ttk.Style(self.window) style.configure('bottomtab.TNotebook', tabposition='se') notebook_label = ttk.Label(self.window, text="Notebook") notebook_label.grid(row=3, column=2, sticky=tk.W, pady=3) frame4 = ttk.Notebook(self.window, style='bottomtab.TNotebook') tab1 = tk.Frame(frame4) tab2 = tk.Frame(frame4) tab3 = tk.Frame(frame4) tab1.grid_columnconfigure(0, weight= 1) tab1.grid_rowconfigure(0, weight=1) frame4.add(tab1, text="Tab One", compound=tk.BOTTOM) frame4.add(tab2, text="Tab Two", compound=tk.BOTTOM) frame4.add(tab3, text="Tab Three", compound=tk.BOTTOM) frame4.grid(row=4, column=2, sticky=tk.E + tk.W + tk.N + tk.S, padx=30) self.create_buttons(tab1, "J", "K", "L") self.create_buttons(tab2, "M", "N", "O") self.create_buttons(tab3, "P", "Q", "R") # - - - - - - - - - - - - - - - - - - - - - # Quit button in the lower right corner quit_button = ttk.Button(self.window, text="Quit", command=self.window.destroy) quit_button.grid(row=1, column=3)
def Clear(self): self.frm_right_receive.delete("0.0", "end") if __name__ == '__main__': ''' main loop ''' root = tk.Tk() root.columnconfigure(0, weight=1) root.rowconfigure(0, weight=1) root.geometry() monacofont = tkFont.Font(family="Monaco", size=16) root.option_add("*TCombobox*Listbox*background", "#292929") root.option_add("*TCombobox*Listbox*foreground", "#FFFFFF") root.option_add("*TCombobox*Listbox*font", monacofont) root.configure(bg="#292929") combostyle = ttk.Style() combostyle.theme_use('default') combostyle.configure("TCombobox", selectbackground="#292929", fieldbackground="#292929", background="#292929", foreground="#FFFFFF") app = UsbFrame(root) app.frm.pack(fill="both", expand=1) root.mainloop()
def deletePopup(): #Deletetion POPUP _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#d9d9d9' # X11 color: 'gray85' style = ttk.Style() if sys.platform == "win32": style.theme_use('winnative') style.configure('.',background=_bgcolor) style.configure('.',foreground=_fgcolor) style.configure('.',font="TkDefaultFont") style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top = tk.Tk() top.geometry("425x130+789+438") top.title("Delete ...") top.configure(background="#d9d9d9") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="black") blIDtxt = ttk.Label(top) blIDtxt.place(relx=0.01, rely=0.31, height=19, width=136) blIDtxt.configure(background="#d9d9d9") blIDtxt.configure(foreground="#000000") blIDtxt.configure(font="TkDefaultFont") blIDtxt.configure(relief=FLAT) blIDtxt.configure(text='''Set/Branch ID''') blIDbox = ttk.Entry(top) blIDbox.place(relx=0.54, rely=0.31, relheight=0.15, relwidth=0.45) blIDbox.configure(takefocus="") blIDbox.configure(cursor="ibeam") BorSVar = tk.IntVar() BorSVar.set(1) def sbBor(): BorSVar.set(0) #print(BorSVar.get()) def bbBor(): BorSVar.set(1) #print(BorSVar.get()) SetButton = tk.Radiobutton(top, value=0, variable=BorSVar, command=sbBor, activebackground="#d9d9d9", activeforeground="#000000", background="#d9d9d9", disabledforeground="#a3a3a3", foreground="#000000", highlightbackground="#d9d9d9", highlightcolor="black", justify=LEFT, text="Set" ) SetButton.place(relx=0.54, rely=0.08, relheight=0.19, relwidth=0.1) BranchButton = tk.Radiobutton(top, value=1, variable=BorSVar, command=bbBor, activebackground="#d9d9d9", activeforeground="#000000", background="#d9d9d9", disabledforeground="#a3a3a3", foreground="#000000", highlightbackground="#d9d9d9", highlightcolor="black", justify=LEFT, text="Branch" ) BranchButton.place(relx=0.82, rely=0.08, relheight=0.19, relwidth=0.15) def dele(): print("FOR BURGER??") print(BorSVar.get()) if BorSVar.get() == 1: print("1") deleteFunc("branch", blIDbox.get(), blIDbox_2.get()) elif BorSVar.get() == 0: print("0") deleteFunc("set", blIDbox.get(), "") def onClick(): dele() top.destroy() createButton = Button(top) createButton.place(relx=0.39, rely=0.77, height=25, width=90) createButton.configure(activebackground="#d9d9d9") createButton.configure(activeforeground="#000000") createButton.configure(background="#d9d9d9") createButton.configure(disabledforeground="#a3a3a3") createButton.configure(foreground="#000000") createButton.configure(highlightbackground="#d9d9d9") createButton.configure(highlightcolor="black") createButton.configure(pady="0") createButton.configure(relief=GROOVE) createButton.configure(command=onClick) createButton.configure(text='''Delete''') def onClick(): dele() top.destroy() SorB = ttk.Label(top) SorB.place(relx=0.01, rely=0.08, height=19, width=136) SorB.configure(background="#d9d9d9") SorB.configure(foreground="#000000") SorB.configure(font="TkDefaultFont") SorB.configure(relief=FLAT) SorB.configure(text='''Set or Branch''') blIDtxt_1 = ttk.Label(top) blIDtxt_1.place(relx=0.01, rely=0.54, height=19, width=200) blIDtxt_1.configure(background="#d9d9d9") blIDtxt_1.configure(foreground="#000000") blIDtxt_1.configure(font="TkDefaultFont") blIDtxt_1.configure(relief=FLAT) blIDtxt_1.configure(text='''Branch ID (Ignore if deleting set)''') blIDbox_2 = ttk.Entry(top) blIDbox_2.place(relx=0.54, rely=0.54, relheight=0.15, relwidth=0.45) blIDbox_2.configure(takefocus="") blIDbox_2.configure(cursor="ibeam")
def nbPopup(): #New Branch Set Popup Window _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#d9d9d9' # X11 color: 'gray85' style = ttk.Style() if sys.platform == "win32": style.theme_use('winnative') style.configure('.',background=_bgcolor) style.configure('.',foreground=_fgcolor) style.configure('.',font="TkDefaultFont") style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top = tk.Tk() top.geometry("425x154+387+368") top.title("Create New Branch") top.configure(background="#d9d9d9") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="black") #branch set txt label bsIDtxt = ttk.Label(top) bsIDtxt.place(relx=0.01, rely=0.06, height=20, width=86) bsIDtxt.configure(background="#d9d9d9") bsIDtxt.configure(foreground="#000000") bsIDtxt.configure(font="TkDefaultFont") bsIDtxt.configure(relief=FLAT) bsIDtxt.configure(text='Branch Set ID') #branch set id txt box bsIDbox = ttk.Entry(top) bsIDbox.place(relx=0.54, rely=0.06, relheight=0.13, relwidth=0.45) bsIDbox.configure(takefocus="") bsIDbox.configure(cursor="ibeam") blIDtxt = ttk.Label(top) blIDtxt.place(relx=0.01, rely=0.26, height=19, width=136) blIDtxt.configure(background="#d9d9d9") blIDtxt.configure(foreground="#000000") blIDtxt.configure(font="TkDefaultFont") blIDtxt.configure(relief=FLAT) blIDtxt.configure(text='Uncertainty Weight') blIDbox = ttk.Entry(top) blIDbox.place(relx=0.54, rely=0.26, relheight=0.13, relwidth=0.45) blIDbox.configure(takefocus="") blIDbox.configure(cursor="ibeam") attrtTXT = ttk.Label(top) attrtTXT.place(relx=0.42, rely=0.45, height=19, width=180) attrtTXT.configure(background="#d9d9d9") attrtTXT.configure(foreground="#000000") attrtTXT.configure(font="TkDefaultFont") attrtTXT.configure(relief=FLAT) attrtTXT.configure(text='''gmpe_table''') attrtBOX = ttk.Entry(top) attrtBOX.place(relx=0.01, rely=0.58, relheight=0.13, relwidth=0.98) attrtBOX.configure(takefocus="") attrtBOX.configure(cursor="ibeam") createButton = Button(top) createButton.place(relx=0.39, rely=0.78, height=25, width=90) createButton.configure(activebackground="#d9d9d9") createButton.configure(activeforeground="#000000") createButton.configure(background="#d9d9d9") createButton.configure(disabledforeground="#a3a3a3") createButton.configure(foreground="#000000") createButton.configure(highlightbackground="#d9d9d9") createButton.configure(highlightcolor="black") createButton.configure(pady="0") createButton.configure(relief=GROOVE) createButton.configure(text='''Create''') def onClick(): newBranch(bsIDbox.get(), attrtBOX.get(), blIDbox.get()) top.destroy() createButton.configure(command=onClick)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' font10 = "-family {URW Palladio L} -size 11 -underline 1" font11 = "-family {URW Palladio L} -size 10 -underline 1" font12 = "-family {URW Palladio L} -size 10" font13 = "-family {URW Palladio L} -size 9" font9 = "-family {URW Palladio L} -size 11" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.',background=_bgcolor) self.style.configure('.',foreground=_fgcolor) self.style.configure('.',font="TkDefaultFont") self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("816x573+214+82") top.minsize(1, 1) top.maxsize(1351, 738) top.resizable(1, 1) top.title("Report Card App") top.configure(background="#ffffff") top.configure(highlightcolor="black") self.Label1 = tk.Label(top) self.Label1.place(relx=0.257, rely=0.017, height=64, width=393) self.Label1.configure(activebackground="#ffffff") self.Label1.configure(background="#ffffff") self.Label1.configure(borderwidth="6") self.Label1.configure(font="-family {URW Gothic L} -size 14 -weight bold") self.Label1.configure(text='''Report Card''') self.menubar = tk.Menu(top,font="TkMenuFont",bg=_bgcolor,fg=_fgcolor) top.configure(menu = self.menubar) self.Frame1 = tk.Frame(top) self.Frame1.place(relx=0.038, rely=0.14, relheight=0.759, relwidth=0.382) self.Frame1.configure(relief='groove') self.Frame1.configure(borderwidth="6") self.Frame1.configure(relief="groove") self.Frame1.configure(background="#ffffff") self.Entry1 = tk.Entry(self.Frame1) self.Entry1.place(relx=0.317, rely=0.048,height=32, relwidth=0.5) self.Entry1.configure(background="white") self.Entry1.configure(borderwidth="4") self.Entry1.configure(font="TkFixedFont") self.Label3 = tk.Label(self.Frame1) self.Label3.place(relx=0.064, rely=0.172, height=34, width=74) self.Label3.configure(activebackground="#f9f9f9") self.Label3.configure(background="#ffffff") self.Label3.configure(borderwidth="2") self.Label3.configure(font="-family {URW Palladio L} -size 11") self.Label3.configure(text='''Name :''') self.Entry2 = tk.Entry(self.Frame1) self.Entry2.place(relx=0.317, rely=0.172,height=32, relwidth=0.5) self.Entry2.configure(background="white") self.Entry2.configure(borderwidth="4") self.Entry2.configure(font="TkFixedFont") self.Entry2.configure(selectbackground="#c4c4c4") self.Label4 = tk.Label(self.Frame1) self.Label4.place(relx=0.032, rely=0.297, height=33, width=74) self.Label4.configure(activebackground="#f9f9f9") self.Label4.configure(background="#ffffff") self.Label4.configure(borderwidth="2") self.Label4.configure(font="-family {URW Palladio L} -size 11") self.Label4.configure(text='''Class :''') self.Entry3 = tk.Entry(self.Frame1) self.Entry3.place(relx=0.247, rely=0.297,height=32, relwidth=0.212) self.Entry3.configure(background="white") self.Entry3.configure(borderwidth="4") self.Entry3.configure(font="TkFixedFont") self.Entry3.configure(selectbackground="#c4c4c4") self.Entry4 = tk.Entry(self.Frame1) self.Entry4.place(relx=0.683, rely=0.297,height=32, relwidth=0.212) self.Entry4.configure(background="white") self.Entry4.configure(borderwidth="4") self.Entry4.configure(font="TkFixedFont") self.Entry4.configure(selectbackground="#c4c4c4") self.Label5 = tk.Label(self.Frame1) self.Label5.place(relx=0.465, rely=0.297, height=33, width=65) self.Label5.configure(activebackground="#f9f9f9") self.Label5.configure(background="#ffffff") self.Label5.configure(borderwidth="2") self.Label5.configure(cursor="fleur") self.Label5.configure(font="-family {URW Palladio L} -size 11") self.Label5.configure(text='''Sec :''') self.Labelframe1 = tk.LabelFrame(self.Frame1) self.Labelframe1.place(relx=0.032, rely=0.375, relheight=0.577 , relwidth=0.929) self.Labelframe1.configure(relief='groove') self.Labelframe1.configure(font=font10) self.Labelframe1.configure(text='''Marks''') self.Labelframe1.configure(background="#ffffff") self.Label6 = tk.Label(self.Labelframe1) self.Label6.place(relx=0.034, rely=0.159, height=33, width=74 , bordermode='ignore') self.Label6.configure(activebackground="#f9f9f9") self.Label6.configure(background="#ffffff") self.Label6.configure(borderwidth="2") self.Label6.configure(font="-family {URW Palladio L} -size 11") self.Label6.configure(text='''Sub1 :''') self.Label7 = tk.Label(self.Labelframe1) self.Label7.place(relx=0.434, rely=0.159, height=33, width=74 , bordermode='ignore') self.Label7.configure(activebackground="#f9f9f9") self.Label7.configure(background="#ffffff") self.Label7.configure(borderwidth="2") self.Label7.configure(font="-family {URW Palladio L} -size 11") self.Label7.configure(text='''Sub2 :''') self.Label8 = tk.Label(self.Labelframe1) self.Label8.place(relx=0.034, rely=0.359, height=33, width=74 , bordermode='ignore') self.Label8.configure(activebackground="#f9f9f9") self.Label8.configure(background="#ffffff") self.Label8.configure(borderwidth="2") self.Label8.configure(font="-family {URW Palladio L} -size 11") self.Label8.configure(text='''Sub3 :''') self.Label9 = tk.Label(self.Labelframe1) self.Label9.place(relx=0.434, rely=0.359, height=33, width=74 , bordermode='ignore') self.Label9.configure(activebackground="#f9f9f9") self.Label9.configure(background="#ffffff") self.Label9.configure(borderwidth="2") self.Label9.configure(font="-family {URW Palladio L} -size 11") self.Label9.configure(text='''Sub4 :''') self.Label10 = tk.Label(self.Labelframe1) self.Label10.place(relx=0.034, rely=0.558, height=33, width=74 , bordermode='ignore') self.Label10.configure(activebackground="#f9f9f9") self.Label10.configure(background="#ffffff") self.Label10.configure(borderwidth="2") self.Label10.configure(font="-family {URW Palladio L} -size 11") self.Label10.configure(text='''Sub5 :''') self.Label11 = tk.Label(self.Labelframe1) self.Label11.place(relx=0.434, rely=0.558, height=33, width=74 , bordermode='ignore') self.Label11.configure(activebackground="#f9f9f9") self.Label11.configure(background="#ffffff") self.Label11.configure(borderwidth="2") self.Label11.configure(font="-family {URW Palladio L} -size 11") self.Label11.configure(text='''Sub6 :''') self.Label12 = tk.Label(self.Labelframe1) self.Label12.place(relx=0.034, rely=0.757, height=33, width=74 , bordermode='ignore') self.Label12.configure(activebackground="#f9f9f9") self.Label12.configure(background="#ffffff") self.Label12.configure(borderwidth="2") self.Label12.configure(font="-family {URW Palladio L} -size 11") self.Label12.configure(text='''Total :''') self.Label13 = tk.Label(self.Labelframe1) self.Label13.place(relx=0.434, rely=0.757, height=33, width=74 , bordermode='ignore') self.Label13.configure(activebackground="#f9f9f9") self.Label13.configure(background="#ffffff") self.Label13.configure(borderwidth="2") self.Label13.configure(font="-family {URW Palladio L} -size 11") self.Label13.configure(text='''%-age :''') self.Entry5 = tk.Entry(self.Labelframe1) self.Entry5.place(relx=0.234, rely=0.159, height=32, relwidth=0.228 , bordermode='ignore') self.Entry5.configure(background="white") self.Entry5.configure(borderwidth="4") self.Entry5.configure(font="TkFixedFont") self.Entry5.configure(selectbackground="#c4c4c4") self.Entry6 = tk.Entry(self.Labelframe1) self.Entry6.place(relx=0.666, rely=0.159, height=32, relwidth=0.228 , bordermode='ignore') self.Entry6.configure(background="white") self.Entry6.configure(borderwidth="4") self.Entry6.configure(font="TkFixedFont") self.Entry6.configure(selectbackground="#c4c4c4") self.Entry7 = tk.Entry(self.Labelframe1) self.Entry7.place(relx=0.234, rely=0.359, height=32, relwidth=0.228 , bordermode='ignore') self.Entry7.configure(background="white") self.Entry7.configure(borderwidth="4") self.Entry7.configure(font="TkFixedFont") self.Entry7.configure(selectbackground="#c4c4c4") self.Entry8 = tk.Entry(self.Labelframe1) self.Entry8.place(relx=0.666, rely=0.359, height=32, relwidth=0.228 , bordermode='ignore') self.Entry8.configure(background="white") self.Entry8.configure(borderwidth="4") self.Entry8.configure(font="TkFixedFont") self.Entry8.configure(selectbackground="#c4c4c4") self.Entry9 = tk.Entry(self.Labelframe1) self.Entry9.place(relx=0.234, rely=0.558, height=32, relwidth=0.228 , bordermode='ignore') self.Entry9.configure(background="white") self.Entry9.configure(borderwidth="4") self.Entry9.configure(font="TkFixedFont") self.Entry9.configure(selectbackground="#c4c4c4") self.Entry10 = tk.Entry(self.Labelframe1) self.Entry10.place(relx=0.666, rely=0.558, height=32, relwidth=0.228 , bordermode='ignore') self.Entry10.configure(background="white") self.Entry10.configure(borderwidth="4") self.Entry10.configure(font="TkFixedFont") self.Entry10.configure(selectbackground="#c4c4c4") self.Entry11 = tk.Entry(self.Labelframe1) self.Entry11.place(relx=0.234, rely=0.757, height=32, relwidth=0.228 , bordermode='ignore') self.Entry11.configure(background="white") # configure entry11 state as readonly self.Entry11.configure(state="readonly") self.Entry11.configure(borderwidth="4") self.Entry11.configure(font="TkFixedFont") self.Entry11.configure(selectbackground="#c4c4c4") self.Entry12 = tk.Entry(self.Labelframe1) self.Entry12.place(relx=0.666, rely=0.757, height=32, relwidth=0.228 , bordermode='ignore') self.Entry12.configure(background="white") # configure entry12 state as readonly self.Entry12.configure(state="readonly") self.Entry12.configure(borderwidth="4") self.Entry12.configure(font="TkFixedFont") self.Entry12.configure(selectbackground="#c4c4c4") self.Label2 = tk.Label(top) self.Label2.place(relx=0.063, rely=0.175, height=31, width=77) self.Label2.configure(background="#ffffff") self.Label2.configure(borderwidth="2") self.Label2.configure(font=font9) self.Label2.configure(text='''Roll no :''') self.Button1 = tk.Button(top) self.Button1.place(relx=0.074, rely=0.908, height=34, width=59) self.Button1.configure(borderwidth="3") self.Button1.configure(font=font13) self.Button1.configure(text='''Add''') # add student details def addStudent(self): #clear total and %-age field self.Entry11.delete(0,tk.END) self.Entry12.delete(0,tk.END) #fetch the roll no rollno=self.Entry1.get() #if the rollno is empty then the data cannot be entered. if rollno=="": #import messagebox from tkinter mb.showinfo(title="Data error",message="Some fields are Empty") else: #create 2 values of stringvar() # import StringVar() from tkinter value1=StringVar() value2=StringVar() #calculate the total of 6 subjects totalvalue=int(self.Entry5.get())+int(self.Entry6.get())+int(self.Entry7.get())+int(self.Entry8.get())+int(self.Entry9.get())+int(self.Entry10.get()) # now make total and %-age field as non editable self.Entry11.configure(textvariable=value1,foreground="black") self.Entry12.configure(textvariable=value2,foreground="black") #calculate the percentage per=(totalvalue/600)*100 # i need only 2 decimal value after a decimal dper="{:.2f}".format(per) # append percent symbol to the value obtained. finalper=str(dper)+"%" #now set these sum and percentage values to their respective entryfields value2.set(finalper) value1.set(str(totalvalue)) #now lets store the student details in their respective student rollno file rollno_file=rollno[0:10]+".txt" #now i need a seperate folder to store all the files #import join function from os from os.path import join as pjoin #place your own path and create a folder named studentFiles path_to_file=pjoin("/","home","lonewolf","Documents/repo/Report-Card-Gui","studentFiles",rollno_file) #now open the rollno file and enter the entries in it. with open(path_to_file,"w") as wr: wr.write("Student RollNo:"+str(self.Entry1.get())+"\n"+ "Student Name:"+str(self.Entry2.get())+"\n"+ "Class:"+str(self.Entry3.get())+"\n"+ "Sec:"+str(self.Entry4.get())+"\n"+ "Sub1:"+str(self.Entry5.get())+"\n"+ "Sub2:"+str(self.Entry6.get())+"\n"+ "Sub3:"+str(self.Entry7.get())+"\n"+ "Sub4:"+str(self.Entry8.get())+"\n"+ "Sub5:"+str(self.Entry9.get())+"\n"+ "Sub6:"+str(self.Entry10.get())+"\n"+ "Total:"+str(self.Entry11.get())+"\n"+ "Percentage:"+str(self.Entry12.get())+"\n") #show a dialog showing data added successfully mb.showinfo(title="Data Storing",message="Student Detail Added") wr.close() # call the function when add button is pressed. self.Button1.configure(command=lambda : addStudent(self)) self.Button2 = tk.Button(top) self.Button2.place(relx=0.184, rely=0.908, height=33, width=63) self.Button2.configure(borderwidth="3") self.Button2.configure(font=font12) self.Button2.configure(text='''Clear''') def clearDetails(self): #clear all the text present in the enrty fields self.Entry1.delete(0,tk.END) self.Entry2.delete(0,tk.END) self.Entry3.delete(0,tk.END) self.Entry4.delete(0,tk.END) self.Entry5.delete(0,tk.END) self.Entry6.delete(0,tk.END) self.Entry7.delete(0,tk.END) self.Entry8.delete(0,tk.END) self.Entry9.delete(0,tk.END) self.Entry10.delete(0,tk.END) self.Entry11.delete(0,tk.END) self.Entry12.delete(0,tk.END) self.Button2.configure(command=lambda:clearDetails(self)) self.Button3 = tk.Button(top) self.Button3.place(relx=0.306, rely=0.908, height=33, width=59) self.Button3.configure(borderwidth="3") self.Button3.configure(font=font12) self.Button3.configure(text='''Delete''') def deleteStudent(self): import os #to delete file fetch the rollno from entry1 delFile=self.Entry1.get() if os.path.isfile('/home/lonewolf/Documents/repo/Report-Card-Gui/studentFiles/'+delFile+'.txt')==True: os.remove('/home/lonewolf/Documents/repo/Report-Card-Gui/studentFiles/'+delFile+'.txt') mb.showinfo(title="Data Deletion",message="Data Deleted") else: mb.showinfo(title="File Not Found",message="No Data Found") self.Button3.configure(command=lambda:deleteStudent(self)) self.TSeparator2 = ttk.Separator(top) self.TSeparator2.place(relx=0.453, rely=0.14, relheight=0.75) self.TSeparator2.configure(orient="vertical") self.Labelframe2 = tk.LabelFrame(top) self.Labelframe2.place(relx=0.478, rely=0.122, relheight=0.777 , relwidth=0.477) self.Labelframe2.configure(relief='groove') self.Labelframe2.configure(borderwidth="4") self.Labelframe2.configure(font=font11) self.Labelframe2.configure(text='''VeiwData''') self.Labelframe2.configure(background="#ffffff") self.Text1 = tk.Text(self.Labelframe2) self.Text1.place(relx=0.026, rely=0.045, relheight=0.935, relwidth=0.53 , bordermode='ignore') self.Text1.configure(background="white") self.Text1.configure(font="TkTextFont") self.Text1.configure(selectbackground="#c4c4c4") self.Text1.configure(wrap="word") self.Listbox1 = tk.Listbox(self.Labelframe2) self.Listbox1.place(relx=0.566, rely=0.045, relheight=0.926 , relwidth=0.396, bordermode='ignore') self.Listbox1.configure(background="white") self.Listbox1.configure(font="TkFixedFont") self.Button4 = tk.Button(top) self.Button4.place(relx=0.49, rely=0.908, height=29, width=375) self.Button4.configure(borderwidth="3") self.Button4.configure(font=font12) self.Button4.configure(text='''View Data''') def viewData(self): #clear the previous content in the listbox self.Listbox1.delete(0,tk.END) import os #list all files in the studentFiles directory flist=os.listdir('/home/lonewolf/Documents/repo/Report-Card-Gui/studentFiles/') flist.sort() for item in flist: #insert all the files present in studentFiles into the listbox self.Listbox1.insert(tk.END,item) def showContent(event): #curserselection x=self.Listbox1.curselection()[0] #get the value of the selection index file=self.Listbox1.get(x) from os.path import join as pjoin pathfile=pjoin("/","home","lonewolf","Documents","repo/Report-Card-Gui","studentFiles/"+file) with open(pathfile,'r') as file: #read the content of the file file=file.read() #delete the previous content in the textfield self.Text1.delete('1.0',tk.END) #insert the selected content in the textfield self.Text1.insert(tk.END,file) self.Listbox1.bind("<<ListboxSelect>>",showContent) self.Button4.configure(command=lambda:viewData(self))
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' global root, x _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("1500x916+227+50") top.minsize(152, 1) top.maxsize(1924, 1055) top.resizable(1, 1) top.title("学生成绩查询") top.configure(background="#d9d9d9") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="black") self.style.configure('Treeview', font="TkDefaultFont") self.Scrolledtreeview1 = ScrolledTreeView(top, show='headings') self.Scrolledtreeview1.place(relx=0.08, rely=0.295, relheight=0.302, relwidth=0.819) self.Scrolledtreeview1.configure( columns="Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8") # build_treeview_support starting. self.Scrolledtreeview1.heading("#0", text="Tree") self.Scrolledtreeview1.heading("#0", anchor="center") self.Scrolledtreeview1.column("#0", width="40") self.Scrolledtreeview1.column("#0", minwidth="20") self.Scrolledtreeview1.column("#0", stretch="1") self.Scrolledtreeview1.column("#0", anchor="center") self.Scrolledtreeview1.heading("Col1", text="学号") self.Scrolledtreeview1.heading("Col1", anchor="center") self.Scrolledtreeview1.column("Col1", width="191") self.Scrolledtreeview1.column("Col1", minwidth="20") self.Scrolledtreeview1.column("Col1", stretch="1") self.Scrolledtreeview1.column("Col1", anchor="center") self.Scrolledtreeview1.heading("Col2", text="姓名") self.Scrolledtreeview1.heading("Col2", anchor="center") self.Scrolledtreeview1.column("Col2", width="95") self.Scrolledtreeview1.column("Col2", minwidth="20") self.Scrolledtreeview1.column("Col2", stretch="1") self.Scrolledtreeview1.column("Col2", anchor="center") self.Scrolledtreeview1.heading("Col3", text="性别") self.Scrolledtreeview1.heading("Col3", anchor="center") self.Scrolledtreeview1.column("Col3", width="97") self.Scrolledtreeview1.column("Col3", minwidth="20") self.Scrolledtreeview1.column("Col3", stretch="1") self.Scrolledtreeview1.column("Col3", anchor="center") self.Scrolledtreeview1.heading("Col4", text="年龄") self.Scrolledtreeview1.heading("Col4", anchor="center") self.Scrolledtreeview1.column("Col4", width="93") self.Scrolledtreeview1.column("Col4", minwidth="20") self.Scrolledtreeview1.column("Col4", stretch="1") self.Scrolledtreeview1.column("Col4", anchor="center") self.Scrolledtreeview1.heading("Col5", text="学院") self.Scrolledtreeview1.heading("Col5", anchor="center") self.Scrolledtreeview1.column("Col5", width="196") self.Scrolledtreeview1.column("Col5", minwidth="20") self.Scrolledtreeview1.column("Col5", stretch="1") self.Scrolledtreeview1.column("Col5", anchor="center") self.Scrolledtreeview1.heading("Col6", text="班级") self.Scrolledtreeview1.heading("Col6", anchor="center") self.Scrolledtreeview1.column("Col6", width="96") self.Scrolledtreeview1.column("Col6", minwidth="20") self.Scrolledtreeview1.column("Col6", stretch="1") self.Scrolledtreeview1.column("Col6", anchor="center") self.Scrolledtreeview1.heading("Col7", text="课程名称") self.Scrolledtreeview1.heading("Col7", anchor="center") self.Scrolledtreeview1.column("Col7", width="200") self.Scrolledtreeview1.column("Col7", minwidth="20") self.Scrolledtreeview1.column("Col7", stretch="1") self.Scrolledtreeview1.column("Col7", anchor="center") self.Scrolledtreeview1.heading("Col8", text="成绩") self.Scrolledtreeview1.heading("Col8", anchor="center") self.Scrolledtreeview1.column("Col8", width="200") self.Scrolledtreeview1.column("Col8", minwidth="20") self.Scrolledtreeview1.column("Col8", stretch="1") self.Scrolledtreeview1.column("Col8", anchor="center") self.Label1 = tk.Label(top) self.Label1.place(relx=0.08, rely=0.066, height=32, width=131) self.Label1.configure(activebackground="#f9f9f9") self.Label1.configure(activeforeground="#000000") self.Label1.configure(background="#d9d9d9") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(font="-family {等线} -size 15") self.Label1.configure(foreground="#000000") self.Label1.configure(highlightbackground="#d9d9d9") self.Label1.configure(highlightcolor="black") self.Label1.configure(text='''姓名查询:''') self.fname = tk.Entry(top) self.fname.place(relx=0.167, rely=0.066, height=31, relwidth=0.123) self.fname.configure(background="white") self.fname.configure(disabledforeground="#a3a3a3") self.fname.configure(font="TkFixedFont") self.fname.configure(foreground="#000000") self.fname.configure(highlightbackground="#d9d9d9") self.fname.configure(highlightcolor="black") self.fname.configure(insertbackground="black") self.fname.configure(selectbackground="#c4c4c4") self.fname.configure(selectforeground="black") self.Label2 = tk.Label(top) self.Label2.place(relx=0.08, rely=0.131, height=32, width=131) self.Label2.configure(activebackground="#f9f9f9") self.Label2.configure(activeforeground="black") self.Label2.configure(background="#d9d9d9") self.Label2.configure(disabledforeground="#a3a3a3") self.Label2.configure(font="-family {等线} -size 15") self.Label2.configure(foreground="#000000") self.Label2.configure(highlightbackground="#d9d9d9") self.Label2.configure(highlightcolor="black") self.Label2.configure(text='''学号查询:''') self.fsno = tk.Entry(top) self.fsno.place(relx=0.167, rely=0.131, height=31, relwidth=0.123) self.fsno.configure(background="white") self.fsno.configure(disabledforeground="#a3a3a3") self.fsno.configure(font="TkFixedFont") self.fsno.configure(foreground="#000000") self.fsno.configure(highlightbackground="#d9d9d9") self.fsno.configure(highlightcolor="black") self.fsno.configure(insertbackground="black") self.fsno.configure(selectbackground="#c4c4c4") self.fsno.configure(selectforeground="black") self.Button1 = tk.Button(top) self.Button1.place(relx=0.313, rely=0.066, height=32, width=62) self.Button1.configure(activebackground="#ececec") self.Button1.configure(activeforeground="#000000") self.Button1.configure(background="#d9d9d9") self.Button1.configure(command=querygrade_support.namefind) self.Button1.configure(disabledforeground="#a3a3a3") self.Button1.configure(font="-family {等线} -size 13") self.Button1.configure(foreground="#000000") self.Button1.configure(highlightbackground="#d9d9d9") self.Button1.configure(highlightcolor="black") self.Button1.configure(pady="0") self.Button1.configure(text='''查询''') self.Button2 = tk.Button(top) self.Button2.place(relx=0.313, rely=0.131, height=37, width=61) self.Button2.configure(activebackground="#ececec") self.Button2.configure(activeforeground="#000000") self.Button2.configure(background="#d9d9d9") self.Button2.configure(command=querygrade_support.snofind) self.Button2.configure(disabledforeground="#a3a3a3") self.Button2.configure(font="-family {等线} -size 13") self.Button2.configure(foreground="#000000") self.Button2.configure(highlightbackground="#d9d9d9") self.Button2.configure(highlightcolor="black") self.Button2.configure(pady="0") self.Button2.configure(text='''查询''') self.Label2_12 = tk.Label(top) self.Label2_12.place(relx=0.08, rely=0.197, height=32, width=131) self.Label2_12.configure(activebackground="#f9f9f9") self.Label2_12.configure(activeforeground="black") self.Label2_12.configure(background="#d9d9d9") self.Label2_12.configure(disabledforeground="#a3a3a3") self.Label2_12.configure(font="-family {等线} -size 15") self.Label2_12.configure(foreground="#000000") self.Label2_12.configure(highlightbackground="#d9d9d9") self.Label2_12.configure(highlightcolor="black") self.Label2_12.configure(text='''全部查询:''') self.Button2_13 = tk.Button(top) self.Button2_13.place(relx=0.173, rely=0.197, height=37, width=281) self.Button2_13.configure(activebackground="#ececec") self.Button2_13.configure(activeforeground="#000000") self.Button2_13.configure(background="#d9d9d9") self.Button2_13.configure(command=querygrade_support.allfind) self.Button2_13.configure(disabledforeground="#a3a3a3") self.Button2_13.configure(font="-family {等线} -size 13") self.Button2_13.configure(foreground="#000000") self.Button2_13.configure(highlightbackground="#d9d9d9") self.Button2_13.configure(highlightcolor="black") self.Button2_13.configure(pady="0") self.Button2_13.configure(text='''查询''') self.Button2_14 = tk.Button(top) self.Button2_14.place(relx=0.687, rely=0.066, height=37, width=281) self.Button2_14.configure(activebackground="#ececec") self.Button2_14.configure(activeforeground="#000000") self.Button2_14.configure(background="#d9d9d9") self.Button2_14.configure(command=querygrade_support.deletes) self.Button2_14.configure(disabledforeground="#a3a3a3") self.Button2_14.configure(font="-family {等线} -size 13") self.Button2_14.configure(foreground="#000000") self.Button2_14.configure(highlightbackground="#d9d9d9") self.Button2_14.configure(highlightcolor="black") self.Button2_14.configure(pady="0") self.Button2_14.configure(text='''删除''') self.Button2_15 = tk.Button(top) self.Button2_15.place(relx=0.687, rely=0.126, height=37, width=281) self.Button2_15.configure(activebackground="#ececec") self.Button2_15.configure(activeforeground="#000000") self.Button2_15.configure(background="#d9d9d9") self.Button2_15.configure(command=querygrade_support.updates) self.Button2_15.configure(disabledforeground="#a3a3a3") self.Button2_15.configure(font="-family {等线} -size 13") self.Button2_15.configure(foreground="#000000") self.Button2_15.configure(highlightbackground="#d9d9d9") self.Button2_15.configure(highlightcolor="black") self.Button2_15.configure(pady="0") self.Button2_15.configure(text='''修改''') self.Button2_16 = tk.Button(top) self.Button2_16.place(relx=0.687, rely=0.186, height=37, width=281) self.Button2_16.configure(activebackground="#ececec") self.Button2_16.configure(activeforeground="#000000") self.Button2_16.configure(background="#d9d9d9") self.Button2_16.configure(command=querygrade_support.adds) self.Button2_16.configure(disabledforeground="#a3a3a3") self.Button2_16.configure(font="-family {等线} -size 13") self.Button2_16.configure(foreground="#000000") self.Button2_16.configure(highlightbackground="#d9d9d9") self.Button2_16.configure(highlightcolor="black") self.Button2_16.configure(pady="0") self.Button2_16.configure(text='''添加''') self.Label3 = tk.Label(top) self.Label3.place(relx=0.413, rely=0.24, height=46, width=175) self.Label3.configure(activebackground="#f9f9f9") self.Label3.configure(activeforeground="black") self.Label3.configure(background="#d9d9d9") self.Label3.configure(disabledforeground="#a3a3a3") self.Label3.configure(font="-family {楷体} -size 16") self.Label3.configure(foreground="#000000") self.Label3.configure(highlightbackground="#d9d9d9") self.Label3.configure(highlightcolor="black") self.Label3.configure(text='''成绩信息表''') def a(*args): global x x = self.TCombobox1.get() self.TCombobox1 = ttk.Combobox(top) self.TCombobox1.place(relx=0.173, rely=0.62, relheight=0.039, relwidth=0.145) self.TCombobox1.configure(textvariable=querygrade_support.combobox) self.TCombobox1.configure(takefocus="") self.TCombobox1["values"] = ("计算机科学与技术学院", "数统学院", "电气学院", "外国语学院", "机械学院", "交通学院") self.TCombobox1["state"] = "readonly" self.TCombobox1.bind("<<ComboboxSelected>>", a) self.TCombobox1.current(0) self.Label2_2 = tk.Label(top) self.Label2_2.place(relx=0.08, rely=0.622, height=32, width=131) self.Label2_2.configure(activebackground="#f9f9f9") self.Label2_2.configure(activeforeground="black") self.Label2_2.configure(background="#d9d9d9") self.Label2_2.configure(disabledforeground="#a3a3a3") self.Label2_2.configure(font="-family {等线} -size 15") self.Label2_2.configure(foreground="#000000") self.Label2_2.configure(highlightbackground="#d9d9d9") self.Label2_2.configure(highlightcolor="black") self.Label2_2.configure(text='''院系排名:''') self.Button2_4 = tk.Button(top) self.Button2_4.place(relx=0.333, rely=0.622, height=37, width=281) self.Button2_4.configure(activebackground="#ececec") self.Button2_4.configure(activeforeground="#000000") self.Button2_4.configure(background="#d9d9d9") self.Button2_4.configure(command=querygrade_support.xspm) self.Button2_4.configure(disabledforeground="#a3a3a3") self.Button2_4.configure(font="-family {等线} -size 13") self.Button2_4.configure(foreground="#000000") self.Button2_4.configure(highlightbackground="#d9d9d9") self.Button2_4.configure(highlightcolor="black") self.Button2_4.configure(pady="0") self.Button2_4.configure(text='''显示排名''') self.Button2_5 = tk.Button(top) self.Button2_5.place(relx=0.6, rely=0.622, height=37, width=210) self.Button2_5.configure(activebackground="#ececec") self.Button2_5.configure(activeforeground="#000000") self.Button2_5.configure(background="#d9d9d9") self.Button2_5.configure(command=querygrade_support.mat1) self.Button2_5.configure(disabledforeground="#a3a3a3") self.Button2_5.configure(font="-family {等线} -size 13") self.Button2_5.configure(foreground="#000000") self.Button2_5.configure(highlightbackground="#d9d9d9") self.Button2_5.configure(highlightcolor="black") self.Button2_5.configure(pady="0") self.Button2_5.configure(text='''及格人数统计表''') self.style.configure('Treeview', font="TkDefaultFont") self.Scrolledtreeview1_1 = ScrolledTreeView(top, show='headings') self.Scrolledtreeview1_1.place(relx=0.073, rely=0.677, relheight=0.302, relwidth=0.675) self.Scrolledtreeview1_1.configure( columns="Col1 Col2 Col3 Col4 Col5 Col6 Col7") # build_treeview_support starting. self.Scrolledtreeview1_1.heading("#0", text="Tree") self.Scrolledtreeview1_1.heading("#0", anchor="center") self.Scrolledtreeview1_1.column("#0", width="38") self.Scrolledtreeview1_1.column("#0", minwidth="20") self.Scrolledtreeview1_1.column("#0", stretch="1") self.Scrolledtreeview1_1.column("#0", anchor="center") self.Scrolledtreeview1_1.heading("Col1", text="学号") self.Scrolledtreeview1_1.heading("Col1", anchor="center") self.Scrolledtreeview1_1.column("Col1", width="189") self.Scrolledtreeview1_1.column("Col1", minwidth="20") self.Scrolledtreeview1_1.column("Col1", stretch="1") self.Scrolledtreeview1_1.column("Col1", anchor="center") self.Scrolledtreeview1_1.heading("Col2", text="姓名") self.Scrolledtreeview1_1.heading("Col2", anchor="center") self.Scrolledtreeview1_1.column("Col2", width="94") self.Scrolledtreeview1_1.column("Col2", minwidth="20") self.Scrolledtreeview1_1.column("Col2", stretch="1") self.Scrolledtreeview1_1.column("Col2", anchor="center") self.Scrolledtreeview1_1.heading("Col3", text="性别") self.Scrolledtreeview1_1.heading("Col3", anchor="center") self.Scrolledtreeview1_1.column("Col3", width="97") self.Scrolledtreeview1_1.column("Col3", minwidth="20") self.Scrolledtreeview1_1.column("Col3", stretch="1") self.Scrolledtreeview1_1.column("Col3", anchor="center") self.Scrolledtreeview1_1.heading("Col4", text="年龄") self.Scrolledtreeview1_1.heading("Col4", anchor="center") self.Scrolledtreeview1_1.column("Col4", width="92") self.Scrolledtreeview1_1.column("Col4", minwidth="20") self.Scrolledtreeview1_1.column("Col4", stretch="1") self.Scrolledtreeview1_1.column("Col4", anchor="center") self.Scrolledtreeview1_1.heading("Col5", text="学院") self.Scrolledtreeview1_1.heading("Col5", anchor="center") self.Scrolledtreeview1_1.column("Col5", width="195") self.Scrolledtreeview1_1.column("Col5", minwidth="20") self.Scrolledtreeview1_1.column("Col5", stretch="1") self.Scrolledtreeview1_1.column("Col5", anchor="center") self.Scrolledtreeview1_1.heading("Col6", text="班级") self.Scrolledtreeview1_1.heading("Col6", anchor="center") self.Scrolledtreeview1_1.column("Col6", width="190") self.Scrolledtreeview1_1.column("Col6", minwidth="20") self.Scrolledtreeview1_1.column("Col6", stretch="1") self.Scrolledtreeview1_1.column("Col6", anchor="center") self.Scrolledtreeview1_1.heading("Col7", text="平均分") self.Scrolledtreeview1_1.heading("Col7", anchor="center") self.Scrolledtreeview1_1.column("Col7", width="97") self.Scrolledtreeview1_1.column("Col7", minwidth="20") self.Scrolledtreeview1_1.column("Col7", stretch="1") self.Scrolledtreeview1_1.column("Col7", anchor="center")
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#d9d9d9' # X11 color: 'gray85' self.style = ttk.Style() self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("480x146+752+360") top.title("Bully v1.1") self.BSSID = Entry(top) self.BSSID.place(relx=0.13, rely=0.07, relheight=0.14, relwidth=0.35) self.BSSID.configure(textvariable=bully_support.bssid) self.BSSID.configure(width=166) self.ESSID = Entry(top) self.ESSID.place(relx=0.63, rely=0.07, relheight=0.14, relwidth=0.35) self.ESSID.configure(textvariable=bully_support.essid) self.ESSID.configure(width=166) self.mes46 = Message(top) self.mes46.place(relx=0.0, rely=0.07, relheight=0.14, relwidth=0.13) self.mes46.configure(text='''BSSID:''') self.mes46.configure(width=63) self.Message2 = Message(top) self.Message2.place(relx=0.5, rely=0.07, relheight=0.14, relwidth=0.11) self.Message2.configure(text='''ESSID:''') self.Message2.configure(width=70) self.channel = ttk.Combobox(top) self.channel.place(relx=0.17, rely=0.21, relheight=0.12, relwidth=0.1) self.value_list = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,] self.channel.configure(values=self.value_list) self.channel.configure(textvariable=bully_support.channel) self.channel.configure(width=47) self.channel.configure(takefocus="") self.channel.delete(0,"end") self.channel.insert(0,1) self.Message4 = Message(top) self.Message4.place(relx=0.54, rely=0.21, relheight=0.14, relwidth=0.08) self.Message4.configure(text='''PIN:''') self.Message4.configure(width=70) self.Entry1 = Entry(top) self.Entry1.place(relx=0.63, rely=0.21, relheight=0.14, relwidth=0.35) self.Entry1.configure(textvariable=bully_support.wps_pin) self.Entry1.configure(width=166) self.Message6 = Message(top) self.Message6.place(relx=0.29, rely=0.21, relheight=0.14, relwidth=0.12) self.Message6.configure(text='''Device:''') self.Message6.configure(width=70) self.Device = ttk.Combobox(top) self.Device.place(relx=0.4, rely=0.21, relheight=0.14, relwidth=0.14) self.Device_list = os.listdir('/sys/class/net/') self.Device.configure(values=self.Device_list) self.Device.configure(textvariable=bully_support.dev) self.Device.configure(width=66) self.Channel = Checkbutton(top) self.Channel.place(relx=0.0, rely=0.21, relheight=0.14, relwidth=0.16) self.Channel.configure(justify=LEFT) self.Channel.configure(text='''Channel:''') self.Channel.configure(variable=bully_support.use_chan) self.Force = Checkbutton(top) self.Force.place(relx=0.0, rely=0.34, relheight=0.14, relwidth=0.12) self.Force.configure(justify=LEFT) self.Force.configure(text='''Force''') self.Force.configure(variable=bully_support.force) self.sequential = Checkbutton(top) self.sequential.place(relx=0.0, rely=0.48, relheight=0.14, relwidth=0.19) self.sequential.configure(justify=LEFT) self.sequential.configure(text='''Sequential''') self.sequential.configure(variable=bully_support.sequential) self.bfcs = Checkbutton(top) self.bfcs.place(relx=0.19, rely=0.34, relheight=0.27, relwidth=0.27) self.bfcs.configure(justify=LEFT) self.bfcs.configure(text='''Brutefoce Checksum digit''') self.bfcs.configure(variable=bully_support.bfcs) self.bfcs.configure(width=131) self.Message3 = Message(top) self.Message3.place(relx=0.48, rely=0.34, relheight=0.14, relwidth=0.15) self.Message3.configure(text='''Verbosity:''') self.Message3.configure(width=70) self.Message7 = Message(top) self.Message7.place(relx=0.48, rely=0.48, relheight=0.14, relwidth=0.14) self.Message7.configure(text='''Lockwait:''') self.Message7.configure(width=70) self.Verbosity = ttk.Combobox(top) self.Verbosity.place(relx=0.63, rely=0.34, relheight=0.12, relwidth=0.08) self.value_list = [1,2,3,4,] self.Verbosity.configure(values=self.value_list) self.Verbosity.configure(textvariable=bully_support.verbosity) self.Verbosity.configure(width=37) self.Verbosity.configure(takefocus="") self.Verbosity.delete(0,"end") self.Verbosity.insert(0,3) self.spi69 = Spinbox(top, from_=0, to=1000) self.spi69.place(relx=0.63, rely=0.48, relheight=0.14, relwidth=0.1) self.spi69.configure(textvariable=bully_support.lockwait) self.spi69.configure(to="1000") self.spi69.configure(width=48) self.spi69.delete(0,"end") self.spi69.insert(0,43) self.pixiewps = Checkbutton(top) self.pixiewps.place(relx=0.73, rely=0.34, relheight=0.14, relwidth=0.16) self.pixiewps.configure(justify=LEFT) self.pixiewps.configure(text='''Pixiewps''') self.pixiewps.configure(variable=bully_support.pixiewps) self.ignore_lockout = Checkbutton(top) self.ignore_lockout.place(relx=0.73, rely=0.48, relheight=0.14 , relwidth=0.24) self.ignore_lockout.configure(justify=LEFT) self.ignore_lockout.configure(text='''Ignore Lockout''') self.ignore_lockout.configure(variable=bully_support.lock_ignore) self.Run = Button(top) self.Run.place(relx=0.02, rely=0.68, height=26, width=70) self.Run.configure(command=bully_support.run_cmd) self.Run.configure(text='''Run''') self.Run.configure(width=70) #self.About = Button(top) #self.About.place(relx=0.81, rely=0.68, height=26, width=72) #self.About.configure(command=bully_support.scan_ap) #self.About.configure(text='''Scan''') #self.About.configure(width=72) self.menubar = Menu(top,bg=_bgcolor,fg=_fgcolor) top.configure(menu = self.menubar) self.advanced = Menu(top,tearoff=0) self.menubar.add_cascade(menu=self.advanced, label="Advanced") self.advanced.add_checkbutton( variable=bully_support.no_ack, label="No Acks") self.advanced.add_checkbutton( variable=bully_support.detect_lock, label="Detect unreported locks") self.advanced.add_checkbutton( variable=bully_support.eap_fail, label="EAP Fail") self.advanced.add_checkbutton( variable=bully_support.no_fcs, label="No FCS") self.advanced.add_checkbutton( variable=bully_support.w7_reg, label="Emulate W7 Registrar") self.advanced.add_checkbutton( variable=bully_support.radiotap, label="Assume Radiotap Headers") self.advanced.add_checkbutton( variable=bully_support.supress, #command=bully_support.TODO, label="Supress packet throttling") #self.menubar.add_command( # command=bully_support.about_us, # label="About") self.Message1 = Message(top) self.Message1.place(relx=0.21, rely=0.68, relheight=0.14, relwidth=0.08) self.Message1.configure(text='''Wait''') self.Message1.configure(width=70) self.Spinbox1 = Spinbox(top, from_=0, to=1000) self.Spinbox1.place(relx=0.29, rely=0.68, relheight=0.14, relwidth=0.08) self.Spinbox1.configure(textvariable=bully_support.m5_1s) self.Spinbox1.configure(to="1000") self.Spinbox1.configure(width=38) self.Spinbox1.delete(0,"end") self.Spinbox1.insert(0,0) self.Message5 = Message(top) self.Message5.place(relx=0.38, rely=0.68, relheight=0.14, relwidth=0.17) self.Message5.configure(text='''seconds per''') self.Message5.configure(width=83) self.Spinbox2 = Spinbox(top, from_=1, to=1000) self.Spinbox2.place(relx=0.56, rely=0.68, relheight=0.14, relwidth=0.08) self.Spinbox2.configure(textvariable=bully_support.m5_1a) self.Spinbox2.configure(to="1000") self.Spinbox2.configure(width=38) self.Spinbox2.delete(0,"end") self.Spinbox2.insert(0,1) self.Message8 = Message(top) self.Message8.place(relx=0.65, rely=0.68, relheight=0.14, relwidth=0.13) self.Message8.configure(text='''attempt''') self.Message8.configure(width=70)
width=15, command=beenClicked, bg='darkgreen', fg='white', font="none 18 bold") throw_button.grid(row=5, column=1, padx=5, pady=15) exit_button = Button(app, text='Exit', command=exit, bg='#333333', fg='white', font="none 18 bold") exit_button.grid(row=5, column=2, padx=5, pady=15, sticky=SE) s = ttk.Style() s.theme_use('classic') s.configure('red.Horizontal.TProgressbar', troughcolor='white', background=app.bad_good_colors[0]) hp_bar = ttk.Progressbar(app, style="red.Horizontal.TProgressbar", orient='horizontal', length=800) hp_bar.grid(row=6, columnspan=3) hp_bar['value'] = app.hp_current hp_bar['maximum'] = app.hp_max app.mainloop() ## Thoughts on things to add
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.',background=_bgcolor) self.style.configure('.',foreground=_fgcolor) self.style.configure('.',font="TkDefaultFont") self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("1280x686+212+135") top.minsize(120, 1) top.maxsize(3004, 1913) top.resizable(1, 1) top.title("New Toplevel") top.configure(background="#000040") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="#000000") self.menubar = tk.Menu(top,font="TkMenuFont",bg=_bgcolor,fg=_fgcolor) top.configure(menu = self.menubar) self.TSeparator3 = ttk.Separator(top) self.TSeparator3.place(relx=0.165, rely=0.168, relheight=0.845) self.TSeparator3.configure(orient="vertical") self.TSeparator4 = ttk.Separator(top) self.TSeparator4.place(relx=0.818, rely=0.168, relheight=0.835) self.TSeparator4.configure(orient="vertical") self.Movie1 = tk.Frame(top) self.Movie1.place(relx=0.18, rely=0.364, relheight=0.137, relwidth=0.621) self.Movie1.configure(relief='groove') self.Movie1.configure(borderwidth="2") self.Movie1.configure(relief="groove") self.Movie1.configure(background="#00002b") self.Movie1.configure(highlightbackground="#d9d9d9") self.Movie1.configure(highlightcolor="black") self.Description1 = tk.Label(self.Movie1) self.Description1.place(relx=0.025, rely=0.106, height=32, width=764) self.Description1.configure(activebackground="#f9f9f9") self.Description1.configure(activeforeground="black") self.Description1.configure(anchor='nw') self.Description1.configure(background="#00002b") self.Description1.configure(disabledforeground="#a3a3a3") self.Description1.configure(font="-family {Segoe UI} -size 12") self.Description1.configure(foreground="#bcfbfe") self.Description1.configure(highlightbackground="#d9d9d9") self.Description1.configure(highlightcolor="black") self.Description1.configure(text='''Name of cinema with address''') self.Label3 = tk.Label(self.Movie1) self.Label3.place(relx=0.038, rely=0.638, height=21, width=54) self.Label3.configure(activebackground="#f9f9f9") self.Label3.configure(activeforeground="black") self.Label3.configure(background="#d9d9d9") self.Label3.configure(disabledforeground="#a3a3a3") self.Label3.configure(foreground="#000000") self.Label3.configure(highlightbackground="#d9d9d9") self.Label3.configure(highlightcolor="black") self.Label3.configure(text='''timings''') self.Label4 = tk.Label(self.Movie1) self.Label4.place(relx=0.138, rely=0.638, height=21, width=55) self.Label4.configure(activebackground="#f9f9f9") self.Label4.configure(activeforeground="black") self.Label4.configure(background="#d9d9d9") self.Label4.configure(disabledforeground="#a3a3a3") self.Label4.configure(foreground="#000000") self.Label4.configure(highlightbackground="#d9d9d9") self.Label4.configure(highlightcolor="black") self.Label4.configure(text='''timings''')
def __init__(self, master=None): # Initialize variables self.angle = 0 self.angle_calibration = 0 self.range = 0 self.range_calibration = 0 self.phase_ant1 = 0 self.phase_ant2 = 0 self.corrected_phase_delta = 0 self.show_phase = 1 self.matlab_call_cnt = 0 self.show_corrected_phase_delta = 0 if self.show_corrected_phase_delta: self.show_phase = 0 # Set background of toplevel window to match # current style if self.show_phase == 0: root.geometry("{0}x{1}+0+0".format( root.winfo_screenwidth() * 5 / 6, root.winfo_screenheight() / 4)) if self.show_corrected_phase_delta: root.geometry("{0}x{1}+0+0".format( root.winfo_screenwidth() * 5 / 6, root.winfo_screenheight() / 3)) style = ttk.Style() theme = style.theme_use() default = style.lookup(theme, 'background') master.configure(background='ivory') self.state = 'begin' # GUI design: # ----------------------------------------------------------------------- # | Angle:(label1) | -1 (label3) | (label5) | | # ----------------------------------------------------------------------- # | Distance:(label2) | 2.53m(label4) | (label6) | | # ----------------------------------------------------------------------- # | Phase_Ant1:(label7) | 209 (label9) | # ----------------------------------------------------------------------- # | Phase_Ant2:(label8) | 173 (label10) | # ----------------------------------------------------------------------- self.label = Label(master) # self.label.place(relx=0.01+0.315, rely=0.04+0.22, relheight=.50,relwidth=0.50) self.label.configure(activebackground="#f9f9f9") self.label.configure(activeforeground="black") self.label.configure(background="ivory") self.label.configure(foreground="black") self.label.configure(highlightbackground="#d9d9d9") self.label.configure(highlightcolor="black") # Configure Text here. self.label.configure(text="Angle: ", font=("Courier", 88), width=13) # self.label.configure(justify="center") self.label2 = Label(root, text="Distance: ", font=("Courier", 88), width=13) self.label3 = Label(root, text="...", font=("Courier", 88), width=8) self.label4 = Label(root, text="...", font=("Courier", 88), width=8) # self.label5 = Label(root, text="", font=("Courier", 88), width=2) # self.label6 = Label(root, text="", font=("Courier", 88), width=2) if self.show_phase: self.label7 = Label(root, text="Phase Ant1: ", font=("Courier", 88), width=13) self.label8 = Label(root, text="Phase Ant2: ", font=("Courier", 88), width=13) self.label9 = Label(root, text="...", font=("Courier", 88), width=8) self.label10 = Label(root, text="...", font=("Courier", 88), width=8) elif self.show_corrected_phase_delta: self.label7 = Label(root, text="Phase delta: ", font=("Courier", 56), width=20) self.label9 = Label(root, text="...", font=("Courier", 56), width=8) self.label.configure(background="ivory") self.label2.configure(background="ivory") self.label3.configure(background="ivory") self.label4.configure(background="ivory") # self.label5.configure(background="ivory") # self.label6.configure(background="ivory") if self.show_phase: self.label7.configure(background="ivory") self.label8.configure(background="ivory") self.label9.configure(background="ivory") self.label10.configure(background="ivory") elif self.show_corrected_phase_delta: self.label7.configure(background="ivory") self.label9.configure(background="ivory") self.label.configure(foreground="black") self.label2.configure(foreground="black") self.label3.configure(foreground="black") self.label4.configure(foreground="black") if self.show_phase: self.label7.configure(foreground="black") self.label8.configure(foreground="black") self.label9.configure(foreground="black") self.label10.configure(foreground="black") elif self.show_corrected_phase_delta: self.label7.configure(foreground="black") self.label9.configure(foreground="black") self.label.grid(row=0, sticky=E) self.label2.grid(row=1, sticky=E) self.label3.grid(row=0, column=1, sticky=E) self.label4.grid(row=1, column=1, sticky=E) # self.label5.grid(row=0, column=2, sticky=E) # self.label6.grid(row=1, column=2, sticky=E) if self.show_phase: self.label7.grid(row=2, sticky=E) self.label8.grid(row=3, sticky=E) self.label9.grid(row=2, column=1, sticky=E) self.label10.grid(row=3, column=1, sticky=E) elif self.show_corrected_phase_delta: self.label7.grid(row=2, sticky=E) self.label9.grid(row=2, column=1, sticky=E)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#d9d9d9' # X11 color: 'gray85' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.',background=_bgcolor) self.style.configure('.',foreground=_fgcolor) self.style.configure('.',font="TkDefaultFont") self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("600x448+733+301") top.title("Settings Editor") top.configure(background="#d9d9d9") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="black") top.resizable(False, False) def export(data): toExp = json.dumps(json.dumps(ltData)) top.filename = filedialog.asksaveasfilename(initialdir = "/",title = "Select file",filetypes = (("XML file","*.xml"), ("all files","*.*"))) if top.filename == "": return 0 top.filename = top.filename+".xml" os.system('python ../gmpe-handler.py -output "'+top.filename+'" -ltd '+toExp) def tab_changed(event): curTab = self.notebook.index("current") if curTab == 1: top.geometry("670x650") else: top.geometry("600x448") self.style.configure('TNotebook.Tab', background=_bgcolor) self.style.configure('TNotebook.Tab', foreground=_fgcolor) self.style.map('TNotebook.Tab', background= [('selected', _compcolor), ('active',_ana2color)]) self.notebook = ttk.Notebook(top) self.notebook.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0) self.notebook_t0 = Frame(self.notebook) self.notebook.add(self.notebook_t0, padding=3) self.notebook.tab(0, text="GMPE Logic Tree", compound="left" ,underline="-1",) self.notebook.bind("<<NotebookTabChanged>>", tab_changed) self.notebook_t0.configure(background="#d9d9d9") self.notebook_t0.configure(highlightbackground="#d9d9d9") self.notebook_t0.configure(highlightcolor="black") self.notebook_t1 = Frame(self.notebook) self.notebook.add(self.notebook_t1, padding=3) self.notebook.tab(1, text="Job.ini",compound="left",underline="-1",) self.notebook_t1.configure(background="#d9d9d9") self.notebook_t1.configure(highlightbackground="#d9d9d9") self.notebook_t1.configure(highlightcolor="black") self.Scrolledtext1 = ScrolledText(self.notebook_t0) self.Scrolledtext1.place(relx=0.0, rely=0.07, relheight=0.76 , relwidth=1.0) self.Scrolledtext1.configure(background="white") self.Scrolledtext1.configure(font="TkTextFont") self.Scrolledtext1.configure(foreground="black") self.Scrolledtext1.configure(highlightbackground="#d9d9d9") self.Scrolledtext1.configure(highlightcolor="black") self.Scrolledtext1.configure(insertbackground="black") self.Scrolledtext1.configure(insertborderwidth="3") self.Scrolledtext1.configure(selectbackground="#c4c4c4") self.Scrolledtext1.configure(selectforeground="black") self.Scrolledtext1.configure(state=DISABLED) self.Scrolledtext1.configure(width=10) self.Scrolledtext1.configure(wrap=NONE) setoutput(self.Scrolledtext1) self.Export = Button(self.notebook_t0) self.Export.place(relx=0.47, rely=0.01, height=21, width=44) self.Export.configure(activebackground="#bababa") self.Export.configure(activeforeground="#000000") self.Export.configure(background="#bababa") self.Export.configure(disabledforeground="#a3a3a3") self.Export.configure(foreground="#000000") self.Export.configure(highlightbackground="#d9d9d9") self.Export.configure(highlightcolor="black") self.Export.configure(pady="0") self.Export.configure(relief=FLAT) self.Export.configure(text='''Export''') self.Export.configure(command=lambda: export(ltData)) self.BranchButton = Button(self.notebook_t0) self.BranchButton.place(relx=0.0, rely=0.85, height=55, width=198) self.BranchButton.configure(activebackground="#bababa") self.BranchButton.configure(activeforeground="#000000") self.BranchButton.configure(background="#bababa") self.BranchButton.configure(disabledforeground="#a3a3a3") self.BranchButton.configure(foreground="#000000") self.BranchButton.configure(highlightbackground="#d9d9d9") self.BranchButton.configure(highlightcolor="black") self.BranchButton.configure(pady="0") self.BranchButton.configure(relief=FLAT) self.BranchButton.configure(text='''New Branch''') self.BranchButton.configure(width=77) self.BranchButton.configure(command=lambda: nbPopup()) self.newset = Button(self.notebook_t0) self.newset.place(relx=0.33, rely=0.85, height=55, width=199) self.newset.configure(activebackground="#bababa") self.newset.configure(activeforeground="#000000") self.newset.configure(background="#bababa") self.newset.configure(disabledforeground="#a3a3a3") self.newset.configure(foreground="#000000") self.newset.configure(highlightbackground="#d9d9d9") self.newset.configure(highlightcolor="black") self.newset.configure(pady="0") self.newset.configure(relief=FLAT) self.newset.configure(text='''New Set''') self.newset.configure(command=lambda: nbsPopup()) self.delete = Button(self.notebook_t0) self.delete.place(relx=0.66, rely=0.85, height=55, width=199) self.delete.configure(activebackground="#bababa") self.delete.configure(activeforeground="#000000") self.delete.configure(background="#bababa") self.delete.configure(disabledforeground="#a3a3a3") self.delete.configure(foreground="#000000") self.delete.configure(highlightbackground="#d9d9d9") self.delete.configure(highlightcolor="black") self.delete.configure(pady="0") self.delete.configure(relief=FLAT) self.delete.configure(text='''Delete''') self.delete.configure(command=lambda: deletePopup()) def send(t): #on click global v global atxtbox cmdString = "python ../job-handler.py " for x in range(0,len(v)): x=x+1 curTab = v[x] for z in curTab: curBox = atxtbox[z] txt = curBox.get() print("Val -> "+z+": "+txt) if txt == "": cmdString = cmdString+'-'+z+' " " ' else: cmdString = cmdString+'-'+z+' "'+txt+'" ' cmdString = cmdString+'-outputFile "'+filedialog.asksaveasfilename(initialdir = "/",title = "Select file",filetypes = (("INI file","*.ini"), ("all files","*.*")))+'.ini" ' print(cmdString) os.system(cmdString) self.Save = Button(self.notebook_t1) self.Save.place(relx=0.0, rely=0.0, height=25, relwidth=1) self.Save.configure(activebackground="#bababa") self.Save.configure(background="#bababa") self.Save.configure(disabledforeground="#bababa") self.Save.configure(foreground="#000000") self.Save.configure(highlightbackground="#000000") self.Save.configure(highlightcolor="#000000") self.Save.configure(pady="0") self.Save.configure(relief=FLAT) self.Save.configure(text='''Export''') self.Save.configure(width=380) self.Save.bind("<Button-1>", send) global preset numMade = 0 for z in range(0,len(v)): #print("Z -> "+str(z)) z = z+1 curTab = v[z] for key in curTab: specY = z * 25 self.TLabel1 = ttk.Label(self.notebook_t1) self.TLabel1.place(relx=0.0, y=specY, height=25, width=200) self.TLabel1.configure(background="#d9d9d9") self.TLabel1.configure(foreground="#000000") self.TLabel1.configure(font="TkDefaultFont") self.TLabel1.configure(relief=FLAT) self.TLabel1.configure(text=key) self.TLabel1.configure(wraplength="200") self.TEntry1 = ttk.Entry(self.notebook_t1) self.TEntry1.place(relx=0.4, y=specY, height=25, relwidth=0.6) self.TEntry1.configure(takefocus="") self.TEntry1.configure(width=405) self.TEntry1.configure(cursor="ibeam") self.TEntry1.configure(textvariable=curTab[key]) atxtbox[key] = self.TEntry1 numMade = numMade + 1 specY = specY + 25
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' font11 = "-family {DejaVu Sans} -size 11 -weight bold -slant " \ "italic -underline 0 -overstrike 0" font13 = "-family {DejaVu Sans} -size 13 -weight bold -slant " \ "italic -underline 1 -overstrike 0" font14 = "-family {DejaVu Sans} -size 12 -weight bold -slant " \ "italic -underline 1 -overstrike 0" font21 = "-family {Noto Serif} -size 21 -weight bold -slant " \ "italic -underline 1 -overstrike 0" font9 = "-family {DejaVu Sans} -size 10 -weight bold -slant " \ "italic -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.',background=_bgcolor) self.style.configure('.',foreground=_fgcolor) self.style.configure('.',font="TkDefaultFont") self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("817x450+259+162") top.title("Railways") top.configure(background="#878787") top.configure(highlightcolor="black") self.Labelframe1 = tk.LabelFrame(top) self.Labelframe1.place(relx=0.012, rely=0.378, relheight=0.367 , relwidth=0.49) self.Labelframe1.configure(relief='groove') self.Labelframe1.configure(font="-family {DejaVu Sans} -size 13 -weight bold -slant italic -underline 1") self.Labelframe1.configure(text='''Train Details :''') self.Labelframe1.configure(background="#878787") self.Label3 = tk.Label(self.Labelframe1) self.Label3.place(relx=0.025, rely=0.242, height=22, width=119 , bordermode='ignore') self.Label3.configure(activebackground="#f9f9f9") self.Label3.configure(background="#878787") self.Label3.configure(font=font11) self.Label3.configure(text='''Train Name :''') self.Label4 = tk.Label(self.Labelframe1) self.Label4.place(relx=0.025, rely=0.424, height=22, width=114 , bordermode='ignore') self.Label4.configure(activebackground="#f9f9f9") self.Label4.configure(background="#878787") self.Label4.configure(font=font11) self.Label4.configure(text='''Train No :''') self.Label5 = tk.Label(self.Labelframe1) self.Label5.place(relx=0.025, rely=0.606, height=21, width=119 , bordermode='ignore') self.Label5.configure(activebackground="#f9f9f9") self.Label5.configure(background="#878787") self.Label5.configure(font=font11) self.Label5.configure(text='''From :''') self.Label6 = tk.Label(self.Labelframe1) self.Label6.place(relx=0.0, rely=0.788, height=22, width=125 , bordermode='ignore') self.Label6.configure(activebackground="#f9f9f9") self.Label6.configure(background="#878787") self.Label6.configure(font=font11) self.Label6.configure(text='''To :''') self.Entry3 = tk.Entry(self.Labelframe1) self.Entry3.place(relx=0.325, rely=0.606, height=23, relwidth=0.615 , bordermode='ignore') self.Entry3.configure(background="white") self.Entry3.configure(foreground="#292929") self.Entry3.configure(font="TkFixedFont") self.Entry3.configure(selectbackground="#c4c4c4") self.Entry4 = tk.Entry(self.Labelframe1) self.Entry4.place(relx=0.325, rely=0.788, height=23, relwidth=0.615 , bordermode='ignore') self.Entry4.configure(background="white") self.Entry4.configure(foreground="#292929") self.Entry4.configure(font="TkFixedFont") self.Entry4.configure(selectbackground="#c4c4c4") self.TrainName = ttk.Combobox(self.Labelframe1) self.TrainName['values']=('Shatabdhi','Rani Chenamma','Vishwamanav Express','Intercity Express') self.TrainName.place(relx=0.325, rely=0.242, relheight=0.127 , relwidth=0.618, bordermode='ignore') self.TrainName.configure(takefocus="") self.TrainNo = ttk.Combobox(self.Labelframe1) self.TrainNo['values']=('111','222','333','444','555','666') self.TrainNo.place(relx=0.325, rely=0.424, relheight=0.127 , relwidth=0.618, bordermode='ignore') '''self.TrainNo.configure(textvariable=proj_support.combobox) (commented line)''' self.Labelframe3 = tk.LabelFrame(top) self.Labelframe3.place(relx=0.012, rely=0.756, relheight=0.211 , relwidth=0.49) self.Labelframe3.configure(relief='groove') self.Labelframe3.configure(font=font13) self.Labelframe3.configure(text='''Requirements :''') self.Labelframe3.configure(background="#878787") self.Type = ttk.Combobox(self.Labelframe3) self.Type.place(relx=0.35, rely=0.316, relheight=0.221 , relwidth=0.568, bordermode='ignore') self.Type['values']=('AC','NON-AC','GENRAL','SEATER') self.seat = ttk.Combobox(self.Labelframe3) self.seat.place(relx=0.35, rely=0.632, relheight=0.221 , relwidth=0.568, bordermode='ignore') self.seat['values']=('1','2','3','4','5','6') self.seat.configure(takefocus="") self.Label9 = tk.Label(self.Labelframe3) self.Label9.place(relx=0.025, rely=0.316, height=22, width=118 , bordermode='ignore') self.Label9.configure(background="#878787") self.Label9.configure(font=font11) self.Label9.configure(text='''Type of seat :''') self.Label10 = tk.Label(self.Labelframe3) self.Label10.place(relx=0.05, rely=0.632, height=22, width=108 , bordermode='ignore') self.Label10.configure(background="#878787") self.Label10.configure(font=font11) self.Label10.configure(text='''No of seats :''') global _images _images = ( tk.PhotoImage("img_close", data='''R0lGODlhDAAMAIQUADIyMjc3Nzk5OT09PT 8/P0JCQkVFRU1NTU5OTlFRUVZWVmBgYGF hYWlpaXt7e6CgoLm5ucLCwszMzNbW 1v//////////////////////////////////// ///////////yH5BAEKAB8ALA AAAAAMAAwAAAUt4CeOZGmaA5mSyQCIwhCUSwEIxHHW+ fkxBgPiBDwshCWHQfc5 KkoNUtRHpYYAADs= '''), tk.PhotoImage("img_closeactive", data='''R0lGODlhDAAMAIQcALwuEtIzFL46 INY0Fdk2FsQ8IdhAI9pAIttCJNlKLtpLL9pMMMNTP cVTPdpZQOBbQd60rN+1rf Czp+zLxPbMxPLX0vHY0/fY0/rm4vvx8Pvy8fzy8P//////// ///////yH5BAEK AB8ALAAAAAAMAAwAAAVHYLQQZEkukWKuxEgg1EPCcilx24NcHGYWFhx P0zANBE GOhhFYGSocTsax2imDOdNtiez9JszjpEg4EAaA5jlNUEASLFICEgIAOw== '''), tk.PhotoImage("img_closepressed", data='''R0lGODlhDAAMAIQeAJ8nD64qELE rELMsEqIyG6cyG7U1HLY2HrY3HrhBKrlCK6pGM7lD LKtHM7pKNL5MNtiViNaon +GqoNSyq9WzrNyyqtuzq+O0que/t+bIwubJw+vJw+vTz+zT z////////yH5BAE KAB8ALAAAAAAMAAwAAAVJIMUMZEkylGKuwzgc0kPCcgl123NcHWYW Fs6Gp2mYB IRgR7MIrAwVDifjWO2WwZzpxkxyfKVCpImMGAeIgQDgVLMHikmCRUpMQgA7 ''') ) self.style.element_create("close", "image", "img_close", ("active", "pressed", "!disabled", "img_closepressed"), ("active", "alternate", "!disabled", "img_closeactive"), border=8, sticky='') self.style.layout("ClosetabNotebook", [("ClosetabNotebook.client", {"sticky": "nswe"})]) self.style.layout("ClosetabNotebook.Tab", [ ("ClosetabNotebook.tab", { "sticky": "nswe", "children": [ ("ClosetabNotebook.padding", { "side": "top", "sticky": "nswe", "children": [ ("ClosetabNotebook.focus", { "side": "top", "sticky": "nswe", "children": [ ("ClosetabNotebook.label", {"side": "left", "sticky": ''}), ("ClosetabNotebook.close", {"side": "left", "sticky": ''}),]})]})]})]) PNOTEBOOK = "ClosetabNotebook" self.style.configure('TNotebook.Tab', background=_bgcolor) self.style.configure('TNotebook.Tab', foreground=_fgcolor) self.style.map('TNotebook.Tab', background= [('selected', _compcolor), ('active',_ana2color)]) self.PNotebook1 = ttk.Notebook(top) self.PNotebook1.place(relx=0.514, rely=0.378, relheight=0.591 , relwidth=0.48) self.PNotebook1.configure(takefocus="") self.PNotebook1.configure(style=PNOTEBOOK) self.PNotebook1_t0 = tk.Frame(self.PNotebook1) self.PNotebook1.add(self.PNotebook1_t0, padding=3) self.PNotebook1.tab(0, text="Page 1",compound="none",underline="-1",) self.PNotebook1_t1 = tk.Frame(self.PNotebook1) self.PNotebook1.add(self.PNotebook1_t1, padding=3) self.PNotebook1.tab(1, text="Page 2",compound="none",underline="-1",) self.PNotebook1_t1.configure(background="#878787") self.Labelframe2 = tk.LabelFrame(self.PNotebook1_t0) self.Labelframe2.place(relx=0.026, rely=0.042, relheight=0.938 , relwidth=0.974) self.Labelframe2.configure(relief='groove') self.Labelframe2.configure(font=font14) self.Labelframe2.configure(text='''Customer Details :''') self.Labelframe2.configure(background="#878787") self.Label7 = tk.Label(self.Labelframe2) self.Label7.place(relx=0.026, rely=0.178, height=21, width=99 , bordermode='ignore') self.Label7.configure(background="#878787") self.Label7.configure(font=font11) self.Label7.configure(text='''Name :''') self.Label11 = tk.Label(self.Labelframe2) self.Label11.place(relx=0.026, rely=0.311, height=21, width=99 , bordermode='ignore') self.Label11.configure(background="#878787") self.Label11.configure(font=font11) self.Label11.configure(text='''Age :''') self.Label12 = tk.Label(self.Labelframe2) self.Label12.place(relx=0.026, rely=0.444, height=21, width=99 , bordermode='ignore') self.Label12.configure(background="#878787") self.Label12.configure(font=font11) self.Label12.configure(text='''phone no:''') self.Label13 = tk.Label(self.Labelframe2) self.Label13.place(relx=0.026, rely=0.578, height=22, width=99 , bordermode='ignore') self.Label13.configure(background="#878787") self.Label13.configure(font=font11) self.Label13.configure(text='''Aadhar no :''') self.Entry1 = tk.Entry(self.Labelframe2) self.Entry1.place(relx=0.289, rely=0.178, height=23, relwidth=0.595 , bordermode='ignore') self.Entry1.configure(background="white") self.Entry1.configure(foreground="#292929") self.Entry1.configure(font="TkFixedFont") self.Entry2 = tk.Entry(self.Labelframe2) self.Entry2.place(relx=0.289, rely=0.311, height=23, relwidth=0.595 , bordermode='ignore') self.Entry2.configure(background="white") self.Entry2.configure(foreground="#292929") self.Entry2.configure(font="TkFixedFont") self.Entry5 = tk.Entry(self.Labelframe2) self.Entry5.place(relx=0.289, rely=0.444, height=23, relwidth=0.595 , bordermode='ignore') self.Entry5.configure(background="white") self.Entry5.configure(foreground="#292929") self.Entry5.configure(font="TkFixedFont") self.Entry6 = tk.Entry(self.Labelframe2) self.Entry6.place(relx=0.289, rely=0.578, height=23, relwidth=0.595 , bordermode='ignore') self.Entry6.configure(background="white") self.Entry6.configure(foreground="#292929") self.Entry6.configure(font="TkFixedFont") self.Label14 = tk.Label(self.Labelframe2) self.Label14.place(relx=0.026, rely=0.711, height=21, width=89 , bordermode='ignore') self.Label14.configure(background="#878787") self.Label14.configure(font=font11) self.Label14.configure(text='''Email id :''') self.Entry7 = tk.Entry(self.Labelframe2) self.Entry7.place(relx=0.289, rely=0.711, height=23, relwidth=0.595 , bordermode='ignore') self.Entry7.configure(background="white") self.Entry7.configure(foreground="#292929") self.Entry7.configure(font="TkFixedFont") self.Button1 = tk.Button(self.Labelframe2) self.Button1.place(relx=0.632, rely=0.889, height=21, width=131 , bordermode='ignore') self.Button1.configure(font=font9) self.Button1.configure(text='''View all''') self.B1 = tk.Button(self.Labelframe2) self.B1.place(relx=0.242, rely=0.889, height=21, width=131 , bordermode='ignore') self.B1.configure(font=font9) self.B1.configure(text='''Submit''') self.Label2 = tk.Label(self.Labelframe2) self.Label2.place(relx=1.671, rely=0.378, height=105, width=485 , bordermode='ignore') self.Label2.configure(activebackground="#f9f9f9") self.Label2.configure(background="#ffffff") self.Label2.configure(borderwidth="4") self.Label2.configure(font="-family {DejaVu Sans} -size 17 -weight bold -slant italic") self.Label2.configure(text='''RAILWAY RESERVATION SYSTEM''') self.Scrolledlistbox1 = ScrolledListBox(self.PNotebook1_t1) self.Scrolledlistbox1.place(relx=0.026, rely=0.083, relheight=0.825 , relwidth=0.938) self.Scrolledlistbox1.configure(background="white") self.Scrolledlistbox1.configure(font="TkFixedFont") self.Scrolledlistbox1.configure(highlightcolor="#d9d9d9") self.Scrolledlistbox1.configure(selectbackground="#c4c4c4") self.PNotebook1.bind('<Button-1>',_button_press) self.PNotebook1.bind('<ButtonRelease-1>',_button_release) self.PNotebook1.bind('<Motion>',_mouse_over) self.menubar = tk.Menu(top,font="TkMenuFont",bg=_bgcolor,fg=_fgcolor) top.configure(menu = self.menubar) self.Label2 = tk.Label(top) self.Label2.place(relx=0.428, rely=0.111, height=81, width=449) self.Label2.configure(background="#878787") self.Label2.configure(borderwidth="4") self.Label2.configure(font=font21) self.Label2.configure(text='''Railway Reservation System''') self.Label1 = tk.Label(top) self.Label1.place(relx=0.024, rely=0.022, height=151, width=319) self.Label1.configure(background="#878787") photo_location = os.path.join(prog_location,"/home/navanith/Downloads/112211 (1).png") global _img0 _img0 = tk.PhotoImage(file=photo_location) self.Label1.configure(image=_img0) self.Label1.configure(text='''Label''') def dosomething(): if mb.askyesno('verify','Really Quit ??'): top.destroy() else: mb.showinfo('No','Quit has been cancelled !!!!!!!') top.protocol('WM_DELETE_WINDOW', dosomething)
def setUp(self): self.style = ttk.Style()
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.',background=_bgcolor) self.style.configure('.',foreground=_fgcolor) self.style.configure('.',font="TkDefaultFont") self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("1280x686+212+135") top.minsize(120, 1) top.maxsize(3004, 1913) top.resizable(1, 1) top.title("New Toplevel") top.configure(background="#000040") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="#000000") self.menubar = tk.Menu(top,font="TkMenuFont",bg=_bgcolor,fg=_fgcolor) top.configure(menu = self.menubar) self.Recommended_l = tk.Label(top) self.Recommended_l.place(relx=0.172, rely=0.131, height=48, width=204) self.Recommended_l.configure(activebackground="#f9f9f9") self.Recommended_l.configure(activeforeground="black") self.Recommended_l.configure(background="#000040") self.Recommended_l.configure(borderwidth="5") self.Recommended_l.configure(disabledforeground="#a3a3a3") self.Recommended_l.configure(font="-family {Segoe UI} -size 22") self.Recommended_l.configure(foreground="#ffffff") self.Recommended_l.configure(highlightbackground="#d9d9d9") self.Recommended_l.configure(highlightcolor="black") self.Recommended_l.configure(text='''Recommended!''') self.TSeparator3 = ttk.Separator(top) self.TSeparator3.place(relx=0.165, rely=0.168, relheight=0.845) self.TSeparator3.configure(orient="vertical") self.TSeparator4 = ttk.Separator(top) self.TSeparator4.place(relx=0.818, rely=0.168, relheight=0.835) self.TSeparator4.configure(orient="vertical") self.Movie1 = tk.Frame(top) self.Movie1.place(relx=0.18, rely=0.364, relheight=0.137, relwidth=0.621) self.Movie1.configure(relief='groove') self.Movie1.configure(borderwidth="2") self.Movie1.configure(relief="groove") self.Movie1.configure(background="#00002b") self.Movie1.configure(highlightbackground="#d9d9d9") self.Movie1.configure(highlightcolor="black") self.Description1 = tk.Label(self.Movie1) self.Description1.place(relx=0.025, rely=0.106, height=32, width=764) self.Description1.configure(activebackground="#f9f9f9") self.Description1.configure(activeforeground="black") self.Description1.configure(anchor='nw') self.Description1.configure(background="#00002b") self.Description1.configure(cursor="fleur") self.Description1.configure(disabledforeground="#a3a3a3") self.Description1.configure(font="-family {Segoe UI} -size 12") self.Description1.configure(foreground="#bcfbfe") self.Description1.configure(highlightbackground="#d9d9d9") self.Description1.configure(highlightcolor="black") self.Description1.configure(text='''Name of cinema with address''') self.Label3 = tk.Label(self.Movie1) self.Label3.place(relx=0.038, rely=0.638, height=21, width=54) self.Label3.configure(background="#d9d9d9") self.Label3.configure(disabledforeground="#a3a3a3") self.Label3.configure(foreground="#000000") self.Label3.configure(text='''timings''') self.Label4 = tk.Label(self.Movie1) self.Label4.place(relx=0.138, rely=0.638, height=21, width=55) self.Label4.configure(background="#d9d9d9") self.Label4.configure(disabledforeground="#a3a3a3") self.Label4.configure(foreground="#000000") self.Label4.configure(text='''timings''') self.Previous = tk.Button(top) self.Previous.place(relx=0.383, rely=0.933, height=24, width=47) self.Previous.configure(activebackground="#ececec") self.Previous.configure(activeforeground="#000000") self.Previous.configure(background="#b4eafe") self.Previous.configure(disabledforeground="#a3a3a3") self.Previous.configure(font="-family {Segoe UI} -size 15") self.Previous.configure(foreground="#000000") self.Previous.configure(highlightbackground="#d9d9d9") self.Previous.configure(highlightcolor="black") self.Previous.configure(pady="0") self.Previous.configure(text='''<''') self.Next = tk.Button(top) self.Next.place(relx=0.57, rely=0.933, height=24, width=47) self.Next.configure(activebackground="#ececec") self.Next.configure(activeforeground="#000000") self.Next.configure(background="#b4eafe") self.Next.configure(disabledforeground="#a3a3a3") self.Next.configure(font="-family {Segoe UI} -size 15") self.Next.configure(foreground="#000000") self.Next.configure(highlightbackground="#d9d9d9") self.Next.configure(highlightcolor="black") self.Next.configure(pady="0") self.Next.configure(text='''>''') self.Page_list = tk.Label(top) self.Page_list.place(relx=0.43, rely=0.933, height=21, width=164) self.Page_list.configure(activebackground="#f0f0f0f0f0f0") self.Page_list.configure(activeforeground="black") self.Page_list.configure(background="#000040") self.Page_list.configure(disabledforeground="#a3a3a3") self.Page_list.configure(font="-family {Segoe UI} -size 12") self.Page_list.configure(foreground="#b4eafe") self.Page_list.configure(highlightbackground="#d9d9d9") self.Page_list.configure(highlightcolor="black") self.Page_list.configure(text='''1 of 4''') self.Label2 = tk.Label(top) self.Label2.place(relx=0.461, rely=0.248, height=51, width=74) self.Label2.configure(background="#000040") self.Label2.configure(disabledforeground="#a3a3a3") self.Label2.configure(font="-family {Segoe UI} -size 16") self.Label2.configure(foreground="#bbfcff") self.Label2.configure(text='''Date''') self.Button1 = tk.Button(top) self.Button1.place(relx=0.391, rely=0.262, height=44, width=47) self.Button1.configure(activebackground="#ececec") self.Button1.configure(activeforeground="#000000") self.Button1.configure(background="#5bedf9") self.Button1.configure(disabledforeground="#a3a3a3") self.Button1.configure(font="-family {Segoe UI} -size 18") self.Button1.configure(foreground="#000000") self.Button1.configure(highlightbackground="#d9d9d9") self.Button1.configure(highlightcolor="black") self.Button1.configure(pady="0") self.Button1.configure(text='''<''') self.Button2 = tk.Button(top) self.Button2.place(relx=0.555, rely=0.262, height=44, width=47) self.Button2.configure(activebackground="#ececec") self.Button2.configure(activeforeground="#000000") self.Button2.configure(background="#5bedf9") self.Button2.configure(disabledforeground="#a3a3a3") self.Button2.configure(font="-family {Segoe UI} -size 18") self.Button2.configure(foreground="#000000") self.Button2.configure(highlightbackground="#d9d9d9") self.Button2.configure(highlightcolor="black") self.Button2.configure(pady="0") self.Button2.configure(text='''>''') self.Fast_l = tk.Label(top) self.Fast_l.place(relx=0.18, rely=0.262, height=31, width=64) self.Fast_l.configure(activebackground="#f0f0f0f0f0f0") self.Fast_l.configure(background="#ffff80") self.Fast_l.configure(disabledforeground="#a3a3a3") self.Fast_l.configure(foreground="#000000") self.Fast_l.configure(text='''Fast Filling''') self.Sold_l = tk.Label(top) self.Sold_l.place(relx=0.242, rely=0.262, height=31, width=64) self.Sold_l.configure(activebackground="#f0f0f0f0f0f0") self.Sold_l.configure(background="#b90000") self.Sold_l.configure(disabledforeground="#a3a3a3") self.Sold_l.configure(foreground="#000000") self.Sold_l.configure(text='''Sold Out''') self.Available_f = tk.Label(top) self.Available_f.place(relx=0.305, rely=0.262, height=31, width=67) self.Available_f.configure(background="#00d200") self.Available_f.configure(disabledforeground="#a3a3a3") self.Available_f.configure(foreground="#000000") self.Available_f.configure(text='''Available''')
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.',background=_bgcolor) self.style.configure('.',foreground=_fgcolor) self.style.configure('.',font="TkDefaultFont") self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("1580x824+94+69") top.minsize(120, 1) top.maxsize(3004, 1913) top.resizable(1, 1) top.title("New Toplevel") top.configure(background="#000040") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="#000000") self.menubar = tk.Menu(top,font="TkMenuFont",bg=_bgcolor,fg=_fgcolor) top.configure(menu = self.menubar) self.Membership_f = tk.LabelFrame(top) self.Membership_f.place(relx=0.013, rely=0.218, relheight=0.517 , relwidth=0.132) self.Membership_f.configure(relief='groove') self.Membership_f.configure(foreground="#edea67") self.Membership_f.configure(background="#bfe2ff") self.Membership_f.configure(highlightbackground="#f3fee2") self.Membership_f.configure(highlightcolor="#4bc602") self.Platinum_b = tk.Button(self.Membership_f) self.Platinum_b.place(relx=0.144, rely=0.469, height=84, width=157 , bordermode='ignore') self.Platinum_b.configure(activebackground="#707070") self.Platinum_b.configure(activeforeground="white") self.Platinum_b.configure(activeforeground="#000000") self.Platinum_b.configure(background="#d8d8d8") self.Platinum_b.configure(borderwidth="9") self.Platinum_b.configure(disabledforeground="#a3a3a3") self.Platinum_b.configure(font="-family {Segoe UI} -size 15") self.Platinum_b.configure(foreground="#000000") self.Platinum_b.configure(highlightbackground="#d9d9d9") self.Platinum_b.configure(highlightcolor="black") self.Platinum_b.configure(pady="0") self.Platinum_b.configure(text='''Platinum''') self.Gold_b = tk.Button(self.Membership_f) self.Gold_b.place(relx=0.144, rely=0.728, height=84, width=157 , bordermode='ignore') self.Gold_b.configure(activebackground="#f0df99") self.Gold_b.configure(activeforeground="#000000") self.Gold_b.configure(background="#ffda04") self.Gold_b.configure(borderwidth="9") self.Gold_b.configure(disabledforeground="#a3a3a3") self.Gold_b.configure(font="-family {Segoe UI} -size 15") self.Gold_b.configure(foreground="#000000") self.Gold_b.configure(highlightbackground="#d9d9d9") self.Gold_b.configure(highlightcolor="black") self.Gold_b.configure(pady="0") self.Gold_b.configure(text='''Gold''') self.Diamond_b = tk.Button(self.Membership_f) self.Diamond_b.place(relx=0.144, rely=0.211, height=84, width=157 , bordermode='ignore') self.Diamond_b.configure(activebackground="#d9fcff") self.Diamond_b.configure(activeforeground="#7070fa") self.Diamond_b.configure(background="#2de9f2") self.Diamond_b.configure(borderwidth="9") self.Diamond_b.configure(disabledforeground="#a3a3a3") self.Diamond_b.configure(font="-family {Segoe UI} -size 15") self.Diamond_b.configure(foreground="#000000") self.Diamond_b.configure(highlightbackground="#d9d9d9") self.Diamond_b.configure(highlightcolor="#e9f552") self.Diamond_b.configure(highlightthickness="6") self.Diamond_b.configure(pady="0") self.Diamond_b.configure(text='''Diamond''') self.Label1 = tk.Label(self.Membership_f) self.Label1.place(relx=0.0, rely=0.04, height=50, width=203 , bordermode='ignore') self.Label1.configure(activebackground="#f9f9f9") self.Label1.configure(activeforeground="black") self.Label1.configure(background="#bfe2ff") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(font="-family {Segoe UI} -size 14") self.Label1.configure(foreground="#000000") self.Label1.configure(highlightbackground="#d9d9d9") self.Label1.configure(highlightcolor="black") self.Label1.configure(text='''Join our Membership plan!''') self.Label1.configure(wraplength="200") self.Home_f = tk.LabelFrame(top) self.Home_f.place(relx=0.021, rely=0.039, relheight=0.093 , relwidth=0.319) self.Home_f.configure(relief='groove') self.Home_f.configure(foreground="#000000") self.Home_f.configure(background="#e8e8ff") self.Home_f.configure(highlightbackground="#d9d9d9") self.Home_f.configure(highlightcolor="black") self.home_inner_f = tk.Frame(self.Home_f) self.home_inner_f.place(relx=0.018, rely=0.104, relheight=0.805 , relwidth=0.956, bordermode='ignore') self.home_inner_f.configure(relief='groove') self.home_inner_f.configure(borderwidth="2") self.home_inner_f.configure(relief="groove") self.home_inner_f.configure(background="#b3eaff") self.home_inner_f.configure(highlightbackground="#d9d9d9") self.home_inner_f.configure(highlightcolor="black") self.Home_b = tk.Button(self.home_inner_f) self.Home_b.place(relx=0.021, rely=0.161, height=54, width=77) self.Home_b.configure(activebackground="#ececec") self.Home_b.configure(activeforeground="#000000") self.Home_b.configure(background="#000040") self.Home_b.configure(disabledforeground="#a3a3a3") self.Home_b.configure(font="-family {Segoe UI} -size 12") self.Home_b.configure(foreground="#ffffff") self.Home_b.configure(highlightbackground="#d9d9d9") self.Home_b.configure(highlightcolor="black") self.Home_b.configure(pady="0") self.Home_b.configure(text='''Home''') self.Member_l = tk.Label(self.home_inner_f) self.Member_l.place(relx=0.261, rely=0.129, height=42, width=322) self.Member_l.configure(activebackground="#b3eaff") self.Member_l.configure(activeforeground="black") self.Member_l.configure(background="#b3eaff") self.Member_l.configure(disabledforeground="#a3a3a3") self.Member_l.configure(font="-family {Segoe UI} -size 12") self.Member_l.configure(foreground="#000000") self.Member_l.configure(highlightbackground="#d9d9d9") self.Member_l.configure(highlightcolor="black") self.Member_l.configure(text='''Membership status''') self.Previous_b = tk.Button(top) self.Previous_b.place(relx=0.181, rely=0.285, height=334, width=27) self.Previous_b.configure(activebackground="#000040") self.Previous_b.configure(activeforeground="white") self.Previous_b.configure(activeforeground="#ffffff") self.Previous_b.configure(background="#b3eaff") self.Previous_b.configure(disabledforeground="#a3a3a3") self.Previous_b.configure(font="-family {Segoe UI} -size 20 -weight bold") self.Previous_b.configure(foreground="#000000") self.Previous_b.configure(highlightbackground="#d9d9d9") self.Previous_b.configure(highlightcolor="black") self.Previous_b.configure(pady="0") self.Previous_b.configure(text='''<''') self.Next_b = tk.Button(top) self.Next_b.place(relx=0.648, rely=0.285, height=334, width=27) self.Next_b.configure(activebackground="#000040") self.Next_b.configure(activeforeground="white") self.Next_b.configure(activeforeground="#ffffff") self.Next_b.configure(background="#b3eaff") self.Next_b.configure(disabledforeground="#a3a3a3") self.Next_b.configure(font="-family {Segoe UI} -size 20 -weight bold") self.Next_b.configure(foreground="#000000") self.Next_b.configure(highlightbackground="#d9d9d9") self.Next_b.configure(highlightcolor="black") self.Next_b.configure(pady="0") self.Next_b.configure(text='''>''') self.Labelframe3 = tk.LabelFrame(top) self.Labelframe3.place(relx=0.639, rely=0.036, relheight=0.074 , relwidth=0.259) self.Labelframe3.configure(relief='groove') self.Labelframe3.configure(foreground="black") self.Labelframe3.configure(background="#e8e8ff") self.Labelframe3.configure(highlightbackground="#d9d9d9") self.Labelframe3.configure(highlightcolor="black") self.Search_b = tk.Button(self.Labelframe3) self.Search_b.place(relx=0.024, rely=0.164, height=44, width=87 , bordermode='ignore') self.Search_b.configure(activebackground="#b3eaff") self.Search_b.configure(activeforeground="#000000") self.Search_b.configure(background="#00205b") self.Search_b.configure(disabledforeground="#a3a3a3") self.Search_b.configure(font="-family {Segoe UI} -size 12") self.Search_b.configure(foreground="#ffffff") self.Search_b.configure(highlightbackground="#d9d9d9") self.Search_b.configure(highlightcolor="black") self.Search_b.configure(pady="0") self.Search_b.configure(text='''Search''') self.Search_e = tk.Entry(self.Labelframe3) self.Search_e.place(relx=0.269, rely=0.164, height=40, relwidth=0.719 , bordermode='ignore') self.Search_e.configure(background="white") self.Search_e.configure(disabledforeground="#a3a3a3") self.Search_e.configure(font="-family {Segoe UI} -size 12") self.Search_e.configure(foreground="#000000") self.Search_e.configure(highlightbackground="#d9d9d9") self.Search_e.configure(highlightcolor="black") self.Search_e.configure(insertbackground="black") self.Search_e.configure(selectbackground="blue") self.Search_e.configure(selectforeground="white") self.Label3 = tk.Label(top) self.Label3.place(relx=0.159, rely=0.157, height=58, width=239) self.Label3.configure(activebackground="#f9f9f9") self.Label3.configure(activeforeground="black") self.Label3.configure(background="#000040") self.Label3.configure(borderwidth="5") self.Label3.configure(disabledforeground="#a3a3a3") self.Label3.configure(font="-family {Segoe UI} -size 22") self.Label3.configure(foreground="#ffffff") self.Label3.configure(highlightbackground="#d9d9d9") self.Label3.configure(highlightcolor="black") self.Label3.configure(text='''Recommended!''') self.Book_b = tk.Button(top) self.Book_b.place(relx=0.215, rely=0.752, height=54, width=177) self.Book_b.configure(activebackground="#000040") self.Book_b.configure(activeforeground="white") self.Book_b.configure(activeforeground="#ffffff") self.Book_b.configure(background="#b3eaff") self.Book_b.configure(disabledforeground="#a3a3a3") self.Book_b.configure(font="-family {Segoe UI} -size 14") self.Book_b.configure(foreground="#000000") self.Book_b.configure(highlightbackground="#d9d9d9") self.Book_b.configure(highlightcolor="black") self.Book_b.configure(pady="0") self.Book_b.configure(text='''Book Ticket!''') self.Description_f = tk.LabelFrame(top) self.Description_f.place(relx=0.345, rely=0.728, relheight=0.108 , relwidth=0.287) self.Description_f.configure(relief='groove') self.Description_f.configure(foreground="black") self.Description_f.configure(background="#d9d9d9") self.Description_f.configure(highlightbackground="#d9d9d9") self.Description_f.configure(highlightcolor="black") self.Description_l = tk.Label(self.Description_f) self.Description_l.place(relx=0.009, rely=0.045, height=81, width=445 , bordermode='ignore') self.Description_l.configure(activebackground="#f9f9f9") self.Description_l.configure(activeforeground="black") self.Description_l.configure(anchor='nw') self.Description_l.configure(background="#000040") self.Description_l.configure(disabledforeground="#a3a3a3") self.Description_l.configure(font="-family {Segoe UI} -size 12") self.Description_l.configure(foreground="#ffffff") self.Description_l.configure(highlightbackground="#d9d9d9") self.Description_l.configure(highlightcolor="black") self.Description_l.configure(text='''Description''') self.Info_f = tk.LabelFrame(top) self.Info_f.place(relx=0.685, rely=0.295, relheight=0.388 , relwidth=0.122) self.Info_f.configure(relief='groove') self.Info_f.configure(foreground="black") self.Info_f.configure(background="#000040") self.Info_f.configure(highlightbackground="#d9d9d9") self.Info_f.configure(highlightcolor="black") self.Rating_l = tk.Label(self.Info_f) self.Rating_l.place(relx=0.041, rely=0.025, height=33, width=181 , bordermode='ignore') self.Rating_l.configure(activebackground="#f9f9f9") self.Rating_l.configure(activeforeground="black") self.Rating_l.configure(background="#000040") self.Rating_l.configure(disabledforeground="#a3a3a3") self.Rating_l.configure(font="-family {Segoe UI} -size 14") self.Rating_l.configure(foreground="#ffffff") self.Rating_l.configure(highlightbackground="#d9d9d9") self.Rating_l.configure(highlightcolor="black") self.Rating_l.configure(text='''Rating''') self.TSeparator1 = ttk.Separator(self.Info_f) self.TSeparator1.place(relx=0.026, rely=0.238, relwidth=1.28 , bordermode='ignore') self.Star1 = tk.Label(self.Info_f) self.Star1.place(relx=0.176, rely=0.153, height=17, width=20 , bordermode='ignore') self.Star1.configure(activebackground="#f9f9f9") self.Star1.configure(activeforeground="black") self.Star1.configure(background="#000040") self.Star1.configure(disabledforeground="#a3a3a3") self.Star1.configure(foreground="#000000") self.Star1.configure(highlightbackground="#d9d9d9") self.Star1.configure(highlightcolor="black") self.Star2 = tk.Label(self.Info_f) self.Star2.place(relx=0.306, rely=0.153, height=17, width=20 , bordermode='ignore') self.Star2.configure(activebackground="#f9f9f9") self.Star2.configure(activeforeground="black") self.Star2.configure(background="#000040") self.Star2.configure(disabledforeground="#a3a3a3") self.Star2.configure(foreground="#000000") self.Star2.configure(highlightbackground="#d9d9d9") self.Star2.configure(highlightcolor="black") self.Star3 = tk.Label(self.Info_f) self.Star3.place(relx=0.435, rely=0.153, height=17, width=20 , bordermode='ignore') self.Star3.configure(activebackground="#f9f9f9") self.Star3.configure(activeforeground="black") self.Star3.configure(background="#000040") self.Star3.configure(disabledforeground="#a3a3a3") self.Star3.configure(foreground="#000000") self.Star3.configure(highlightbackground="#d9d9d9") self.Star3.configure(highlightcolor="black") self.Star4 = tk.Label(self.Info_f) self.Star4.place(relx=0.565, rely=0.153, height=17, width=20 , bordermode='ignore') self.Star4.configure(activebackground="#f9f9f9") self.Star4.configure(activeforeground="black") self.Star4.configure(background="#000040") self.Star4.configure(disabledforeground="#a3a3a3") self.Star4.configure(foreground="#000000") self.Star4.configure(highlightbackground="#d9d9d9") self.Star4.configure(highlightcolor="black") self.Star5 = tk.Label(self.Info_f) self.Star5.place(relx=0.694, rely=0.153, height=17, width=20 , bordermode='ignore') self.Star5.configure(activebackground="#f9f9f9") self.Star5.configure(activeforeground="black") self.Star5.configure(background="#000040") self.Star5.configure(disabledforeground="#a3a3a3") self.Star5.configure(foreground="#000000") self.Star5.configure(highlightbackground="#d9d9d9") self.Star5.configure(highlightcolor="black") self.TSeparator2 = ttk.Separator(self.Info_f) self.TSeparator2.place(relx=0.0, rely=0.528, relwidth=1.238 , bordermode='ignore') self.Cast_l = tk.Label(self.Info_f) self.Cast_l.place(relx=0.041, rely=0.556, height=131, width=180 , bordermode='ignore') self.Cast_l.configure(activebackground="#f9f9f9") self.Cast_l.configure(activeforeground="black") self.Cast_l.configure(anchor='nw') self.Cast_l.configure(background="#000040") self.Cast_l.configure(disabledforeground="#a3a3a3") self.Cast_l.configure(font="-family {Segoe UI} -size 12") self.Cast_l.configure(foreground="#ffffff") self.Cast_l.configure(highlightbackground="#d9d9d9") self.Cast_l.configure(highlightcolor="black") self.Cast_l.configure(text='''Cast''') self.Genre_l = tk.Label(self.Info_f) self.Genre_l.place(relx=0.041, rely=0.278, height=58, width=180 , bordermode='ignore') self.Genre_l.configure(activebackground="#f9f9f9") self.Genre_l.configure(activeforeground="black") self.Genre_l.configure(background="#000040") self.Genre_l.configure(disabledforeground="#a3a3a3") self.Genre_l.configure(font="-family {Segoe UI} -size 13") self.Genre_l.configure(foreground="#ffffff") self.Genre_l.configure(highlightbackground="#d9d9d9") self.Genre_l.configure(highlightcolor="black") self.Genre_l.configure(text='''Genre''') self.TSeparator3 = ttk.Separator(top) self.TSeparator3.place(relx=0.165, rely=0.167, relheight=0.846) self.TSeparator3.configure(orient="vertical") self.Label8 = tk.Label(top) self.Label8.place(relx=0.207, rely=0.216, height=49, width=675) self.Label8.configure(activebackground="#f9f9f9") self.Label8.configure(activeforeground="black") self.Label8.configure(anchor='w') self.Label8.configure(background="#000040") self.Label8.configure(disabledforeground="#a3a3a3") self.Label8.configure(font="-family {Segoe UI} -size 20") self.Label8.configure(foreground="#ffffff") self.Label8.configure(highlightbackground="#d9d9d9") self.Label8.configure(highlightcolor="black") self.Label8.configure(text='''Title''') self.TSeparator4 = ttk.Separator(top) self.TSeparator4.place(relx=0.818, rely=0.167, relheight=0.835) self.TSeparator4.configure(orient="vertical") self.Listofmovies_f = tk.LabelFrame(top) self.Listofmovies_f.place(relx=0.829, rely=0.157, relheight=0.831 , relwidth=0.138) self.Listofmovies_f.configure(relief='groove') self.Listofmovies_f.configure(font="-family {Segoe UI} -size 17") self.Listofmovies_f.configure(foreground="#000000") self.Listofmovies_f.configure(text='''List of Movies''') self.Listofmovies_f.configure(background="#d7eeff") self.Listofmovies_f.configure(highlightbackground="#f0f0f0f0f0f0") self.Listofmovies_f.configure(highlightcolor="#646464646464") self.page_id = tk.Label(self.Listofmovies_f) self.page_id.place(relx=0.037, rely=0.947, height=25, width=205 , bordermode='ignore') self.page_id.configure(activebackground="#f9f9f9") self.page_id.configure(activeforeground="black") self.page_id.configure(background="#000040") self.page_id.configure(borderwidth="10") self.page_id.configure(disabledforeground="#a3a3a3") self.page_id.configure(font="-family {Segoe UI} -size 13") self.page_id.configure(foreground="#ffffff") self.page_id.configure(highlightbackground="#d9d9d9") self.page_id.configure(highlightcolor="black") self.page_id.configure(text='''1 of 2''') self.Movie1_b = tk.Button(self.Listofmovies_f) self.Movie1_b.place(relx=0.046, rely=0.058, height=74, width=207 , bordermode='ignore') self.Movie1_b.configure(activebackground="#ececec") self.Movie1_b.configure(activeforeground="#000000") self.Movie1_b.configure(anchor='nw') self.Movie1_b.configure(background="#d7eeff") self.Movie1_b.configure(disabledforeground="#a3a3a3") self.Movie1_b.configure(font="-family {Segoe UI} -size 12") self.Movie1_b.configure(foreground="#000000") self.Movie1_b.configure(highlightbackground="#d9d9d9") self.Movie1_b.configure(highlightcolor="black") self.Movie1_b.configure(pady="0") self.Movie1_b.configure(text='''Movie name \n\nRating: 5/5''') self.Movie_image = tk.Label(top) self.Movie_image.place(relx=0.202, rely=0.285, height=333, width=692) self.Movie_image.configure(activebackground="#f9f9f9") self.Movie_image.configure(activeforeground="black") self.Movie_image.configure(background="#d9d9d9") self.Movie_image.configure(disabledforeground="#a3a3a3") self.Movie_image.configure(foreground="#000000") self.Movie_image.configure(highlightbackground="#d9d9d9") self.Movie_image.configure(highlightcolor="black")
self.hide_calendar() if __name__ == "__main__": def Action(a, b, c): print "DATA ACIONADA" import sys try: from Tkinter import Tk, Frame, Label except ImportError: from tkinter import Tk, Frame, Label root = Tk() root.geometry("500x600") main = Frame(root, pady =15, padx=15) main.pack(expand=True, fill="both") Label(main, justify="left", text=__doc__).pack(anchor="w", pady=(0,15)) date_var = StringVar() date_var.trace("w", Action) Datepicker(main, dateformat="%d/%m/%Y", datevar=date_var).pack(anchor="w") if 'win' not in sys.platform: style = ttk.Style() style.theme_use('clam') root.mainloop()
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("600x450+564+342") top.minsize(148, 1) top.maxsize(1924, 1055) top.resizable(1, 1) top.title("GoldMiner v0.6") top.configure(background="#d9d9d9") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="black") self.Label = tk.Label(top) self.Label.place(relx=0.3, rely=0.067, height=36, width=232) self.Label.configure(activebackground="#f9f9f9") self.Label.configure(activeforeground="black") self.Label.configure(background="#d9d9d9") self.Label.configure(disabledforeground="#a3a3a3") self.Label.configure(font="-family {Segoe UI} -size 13 -underline 1") self.Label.configure(foreground="#000000") self.Label.configure(highlightbackground="#d9d9d9") self.Label.configure(highlightcolor="black") self.Label.configure(text='''Main Menu''') self.Message1 = tk.Message(top) self.Message1.place(relx=0.017, rely=0.156, relheight=0.133, relwidth=0.91) self.Message1.configure(anchor='w') self.Message1.configure(background="#d9d9d9") self.Message1.configure(foreground="#000000") self.Message1.configure(highlightbackground="#d9d9d9") self.Message1.configure(highlightcolor="black") self.Message1.configure(text='''Select an option to execute task. Please allow program to finish before interacting with browser.''') self.Message1.configure(width=546) self.TButton1 = ttk.Button(top) self.TButton1.place(relx=0.033, rely=0.333, height=30, width=318) self.TButton1.configure(takefocus="") self.TButton1.configure( text='''View Current Transcript (Unofficial)''') self.TButton1.configure(compound='left') self.TButton1.configure(command=TButton1Pressed) self.TButton2 = ttk.Button(top) self.TButton2.place(relx=0.033, rely=0.4, height=30, width=318) self.TButton2.configure(takefocus="") self.TButton2.configure(text='''Export Current Transcript (PDF)''') self.TButton2.configure(compound='left') self.TButton2.configure(command=TButton2Pressed) self.TButton1_1 = ttk.Button(top) self.TButton1_1.place(relx=0.033, rely=0.467, height=30, width=318) self.TButton1_1.configure(takefocus="") self.TButton1_1.configure( text='''View Financial Aid Awarded For Current Term''') self.TButton1_1.configure(compound='left') self.TButton1_1.configure(command=TButton1_1Pressed) self.TButton1_2 = ttk.Button(top) self.TButton1_2.place(relx=0.033, rely=0.533, height=30, width=318) self.TButton1_2.configure(takefocus="") self.TButton1_2.configure(text='''Run Degree Evaluation''') self.TButton1_2.configure(compound='left') self.TButton1_2.configure(command=TButton1_2Pressed) self.TButton3 = ttk.Button(top) self.TButton3.place(relx=0.033, rely=0.6, height=30, width=318) self.TButton3.configure(takefocus="") self.TButton3.configure(text='''Export Current Class Schedule (PDF)''') self.TButton3.configure(command=TButton3Pressed) self.TButton4 = ttk.Button(top) self.TButton4.place(relx=0.033, rely=0.667, height=30, width=318) self.TButton4.configure(takefocus="") self.TButton4.configure(text='''View Current Class Schedule''') self.TButton4.configure(command=TButton4Pressed) self.TButton5 = ttk.Button(top) self.TButton5.place(relx=0.033, rely=0.733, height=30, width=318) self.TButton5.configure(takefocus="") self.TButton5.configure( text='''Instant Course Registration (Must Know CRN's)''') self.TButton5.configure(command=TButton5Pressed) self.TButton6 = ttk.Button(top) self.TButton6.place(relx=0.033, rely=0.8, height=30, width=318) self.TButton6.configure(takefocus="") self.TButton6.configure(text='''Save/Update Credentials''') self.TButton6.configure(command=TButton6Pressed) self.Message2 = tk.Message(top) self.Message2.place(relx=0.567, rely=0.289, relheight=0.2, relwidth=0.41) self.Message2.configure(background="#d9d9d9") self.Message2.configure(foreground="#000000") self.Message2.configure(highlightbackground="#d9d9d9") self.Message2.configure(highlightcolor="black") self.Message2.configure( text= '''All exported document can be found in the file labeled "Exports" in the main program directory.''' ) self.Message2.configure(width=246) self.Message3 = tk.Message(top) self.Message3.place(relx=0.567, rely=0.467, relheight=0.4, relwidth=0.41) self.Message3.configure(background="#d9d9d9") self.Message3.configure(foreground="#000000") self.Message3.configure(highlightbackground="#d9d9d9") self.Message3.configure(highlightcolor="black") self.Message3.configure( text= '''***WARNING*** Exporting another copy of the same document will overwrite the previouse version of it. If you would like to keep both copies, rename or move older to a new folder before running export action.''' ) self.Message3.configure(width=246) self.Label1 = tk.Label(top) self.Label1.place(relx=0.8, rely=0.956, height=26, width=132) self.Label1.configure(activebackground="#f9f9f9") self.Label1.configure(activeforeground="black") self.Label1.configure(background="#d9d9d9") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(foreground="#000000") self.Label1.configure(highlightbackground="#d9d9d9") self.Label1.configure(highlightcolor="black") self.Label1.configure(text='''By Jorge Favela''') self.Label1_1 = tk.Label(top) self.Label1_1.place(relx=0.8, rely=0.933, height=16, width=132) self.Label1_1.configure(activebackground="#f9f9f9") self.Label1_1.configure(activeforeground="black") self.Label1_1.configure(background="#d9d9d9") self.Label1_1.configure(disabledforeground="#a3a3a3") self.Label1_1.configure(foreground="#000000") self.Label1_1.configure(highlightbackground="#d9d9d9") self.Label1_1.configure(highlightcolor="black") self.Label1_1.configure(text='''GoldMiner v0.6''')
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#d9d9d9' # X11 color: 'gray85' font9 = "-family {Minion Pro SmBd} -size 9 -weight bold -slant" \ " roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("1320x855+242+93") top.title("Admin Panel ") top.configure(background="#2fd823") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="black") self.Label1 = Label(top) self.Label1.place(relx=0.08, rely=0.02, height=23, width=78) self.Label1.configure(activebackground="#f9f9f9") self.Label1.configure(activeforeground="black") self.Label1.configure(background="#2fd823") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(foreground="#000000") self.Label1.configure(highlightbackground="#d9d9d9") self.Label1.configure(highlightcolor="black") self.Label1.configure(text='''Add Goods''') self.goodname = Label(top) self.goodname.place(relx=0.02, rely=0.12, height=27, width=91) self.goodname.configure(activebackground="#ddef64") self.goodname.configure(activeforeground="#000000") self.goodname.configure(background="#ced877") self.goodname.configure(disabledforeground="#a3a3a3") self.goodname.configure(font=font9) self.goodname.configure(foreground="#000000") self.goodname.configure(highlightbackground="#efa82d") self.goodname.configure(highlightcolor="black") self.goodname.configure(text='''Good Name :''') self.TEntry1 = ttk.Entry(top) self.TEntry1.place(relx=0.09, rely=0.12, relheight=0.03, relwidth=0.13) self.TEntry1.configure(takefocus="") self.TEntry1.configure(cursor="ibeam") self.goodcount = Label(top) self.goodcount.place(relx=0.02, rely=0.16, height=27, width=93) self.goodcount.configure(activebackground="#ef733e") self.goodcount.configure(activeforeground="black") self.goodcount.configure(background="#ced877") self.goodcount.configure(disabledforeground="#a3a3a3") self.goodcount.configure(font=font9) self.goodcount.configure(foreground="#000000") self.goodcount.configure(highlightbackground="#d9d9d9") self.goodcount.configure(highlightcolor="black") self.goodcount.configure(text='''Good Count :''') self.TEntry2 = ttk.Entry(top) self.TEntry2.place(relx=0.09, rely=0.16, relheight=0.03, relwidth=0.13) self.TEntry2.configure(takefocus="") self.TEntry2.configure(cursor="ibeam") self.Label4 = Label(top) self.Label4.place(relx=0.02, rely=0.21, height=27, width=85) self.Label4.configure(activebackground="#f9f9f9") self.Label4.configure(activeforeground="black") self.Label4.configure(background="#ced877") self.Label4.configure(disabledforeground="#a3a3a3") self.Label4.configure(font=font9) self.Label4.configure(foreground="#000000") self.Label4.configure(highlightbackground="#d9d9d9") self.Label4.configure(highlightcolor="black") self.Label4.configure(text='''Good Price :''') self.TEntry3 = ttk.Entry(top) self.TEntry3.place(relx=0.09, rely=0.21, relheight=0.03, relwidth=0.13) self.TEntry3.configure(takefocus="") self.TEntry3.configure(cursor="ibeam") self.Label5 = Label(top) self.Label5.place(relx=0.03, rely=0.07, height=27, width=70) self.Label5.configure(activebackground="#f9f9f9") self.Label5.configure(activeforeground="black") self.Label5.configure(background="#ced877") self.Label5.configure(disabledforeground="#a3a3a3") self.Label5.configure(font=font9) self.Label5.configure(foreground="#000000") self.Label5.configure(highlightbackground="#d9d9d9") self.Label5.configure(highlightcolor="black") self.Label5.configure(text='''Good ID :''') self.TEntry4 = ttk.Entry(top) self.TEntry4.place(relx=0.09, rely=0.07, relheight=0.03, relwidth=0.13) self.TEntry4.configure(takefocus="") self.TEntry4.configure(cursor="ibeam") self.TButton1 = ttk.Button(top) self.TButton1.place(relx=0.04, rely=0.26, height=87, width=218) self.TButton1.configure(command=adminpanel_support.addtodb) self.TButton1.configure(takefocus="") self.TButton1.configure(text='''Add to Database''') self.menubar = Menu(top, font="TkMenuFont", bg=_bgcolor, fg=_fgcolor) top.configure(menu=self.menubar) self.Label2 = Label(top) self.Label2.place(relx=0.33, rely=0.02, height=23, width=95) self.Label2.configure(background="#2fd823") self.Label2.configure(disabledforeground="#a3a3a3") self.Label2.configure(foreground="#000000") self.Label2.configure(text='''Delete Goods''') self.Label3 = Label(top) self.Label3.place(relx=0.29, rely=0.07, height=27, width=60) self.Label3.configure(background="#d86b34") self.Label3.configure(disabledforeground="#a3a3a3") self.Label3.configure(font=font9) self.Label3.configure(foreground="#000000") self.Label3.configure(text='''Good ID''') self.Label6 = Label(top) self.Label6.place(relx=0.27, rely=0.12, height=27, width=83) self.Label6.configure(background="#d86b34") self.Label6.configure(disabledforeground="#a3a3a3") self.Label6.configure(font=font9) self.Label6.configure(foreground="#000000") self.Label6.configure(text='''Good Count''') self.TEntry5 = ttk.Entry(top) self.TEntry5.place(relx=0.36, rely=0.07, relheight=0.03, relwidth=0.06) self.TEntry5.configure(width=76) self.TEntry5.configure(takefocus="") self.TEntry5.configure(cursor="ibeam") self.TEntry6 = ttk.Entry(top) self.TEntry6.place(relx=0.36, rely=0.12, relheight=0.03, relwidth=0.06) self.TEntry6.configure(width=76) self.TEntry6.configure(takefocus="") self.TEntry6.configure(cursor="ibeam") self.deletegoods = ttk.Button(top) self.deletegoods.place(relx=0.3, rely=0.18, height=67, width=168) self.deletegoods.configure(takefocus="") self.deletegoods.configure(text='''Delete''') self.deletegoods.configure(width=168) self.Label7 = Label(top) self.Label7.place(relx=0.58, rely=0.02, height=23, width=100) self.Label7.configure(background="#2fd823") self.Label7.configure(disabledforeground="#a3a3a3") self.Label7.configure(foreground="#000000") self.Label7.configure(text='''Add Employee''') self.Label8 = Label(top) self.Label8.place(relx=0.52, rely=0.07, height=23, width=45) self.Label8.configure(background="#d875a0") self.Label8.configure(disabledforeground="#a3a3a3") self.Label8.configure(font=font9) self.Label8.configure(foreground="#000000") self.Label8.configure(text='''eid''') self.Label8.configure(width=45) self.Label9 = Label(top) self.Label9.place(relx=0.5, rely=0.12, height=27, width=75) self.Label9.configure(background="#d875a0") self.Label9.configure(disabledforeground="#a3a3a3") self.Label9.configure(font=font9) self.Label9.configure(foreground="#000000") self.Label9.configure(text='''First Name''') self.Label10 = Label(top) self.Label10.place(relx=0.5, rely=0.16, height=27, width=72) self.Label10.configure(background="#d875a0") self.Label10.configure(disabledforeground="#a3a3a3") self.Label10.configure(font=font9) self.Label10.configure(foreground="#000000") self.Label10.configure(text='''Last Name''') self.Label11 = Label(top) self.Label11.place(relx=0.48, rely=0.21, height=27, width=104) self.Label11.configure(background="#d875a0") self.Label11.configure(disabledforeground="#a3a3a3") self.Label11.configure(font=font9) self.Label11.configure(foreground="#000000") self.Label11.configure(text='''Mobile Number''') self.TEntry7 = ttk.Entry(top) self.TEntry7.place(relx=0.58, rely=0.07, relheight=0.03, relwidth=0.13) self.TEntry7.configure(takefocus="") self.TEntry7.configure(cursor="ibeam") self.TEntry8 = ttk.Entry(top) self.TEntry8.place(relx=0.58, rely=0.12, relheight=0.03, relwidth=0.13) self.TEntry8.configure(takefocus="") self.TEntry8.configure(cursor="ibeam") self.TEntry9 = ttk.Entry(top) self.TEntry9.place(relx=0.58, rely=0.16, relheight=0.03, relwidth=0.13) self.TEntry9.configure(takefocus="") self.TEntry9.configure(cursor="ibeam") self.TEntry10 = ttk.Entry(top) self.TEntry10.place(relx=0.58, rely=0.21, relheight=0.03, relwidth=0.13) self.TEntry10.configure(takefocus="") self.TEntry10.configure(cursor="ibeam") self.addemployee = ttk.Button(top) self.addemployee.place(relx=0.54, rely=0.27, height=77, width=188) self.addemployee.configure(takefocus="") self.addemployee.configure(text='''Add Employee''') self.addemployee.configure(width=188) self.TLabel1 = ttk.Label(top) self.TLabel1.place(relx=0.79, rely=0.02, height=21, width=115) self.TLabel1.configure(background="#2fd823") self.TLabel1.configure(foreground="#000000") self.TLabel1.configure(font="TkDefaultFont") self.TLabel1.configure(relief=FLAT) self.TLabel1.configure(text='''Delete Employee''') self.Label12 = Label(top) self.Label12.place(relx=0.76, rely=0.07, height=23, width=61) self.Label12.configure(background="#d9d9d9") self.Label12.configure(disabledforeground="#a3a3a3") self.Label12.configure(font=font9) self.Label12.configure(foreground="#000000") self.Label12.configure(text='''eid''') self.Label12.configure(width=61) self.TEntry11 = ttk.Entry(top) self.TEntry11.place(relx=0.82, rely=0.07, relheight=0.03, relwidth=0.07) self.TEntry11.configure(width=96) self.TEntry11.configure(takefocus="") self.TEntry11.configure(cursor="ibeam") self.deleteemployee = ttk.Button(top) self.deleteemployee.place(relx=0.77, rely=0.12, height=57, width=171) self.deleteemployee.configure(takefocus="") self.deleteemployee.configure(text='''Delete Employee''') self.deleteemployee.configure(width=171) self.Label13 = Label(top) self.Label13.place(relx=0.09, rely=0.43, height=23, width=100) self.Label13.configure(background="#2fd823") self.Label13.configure(disabledforeground="#a3a3a3") self.Label13.configure(foreground="#000000") self.Label13.configure(text='''Add Customer''') self.Label14 = Label(top) self.Label14.place(relx=0.04, rely=0.5, height=23, width=91) self.Label14.configure(background="#0dd8bd") self.Label14.configure(disabledforeground="#a3a3a3") self.Label14.configure(font=font9) self.Label14.configure(foreground="#000000") self.Label14.configure(text='''First Name''') self.Label14.configure(width=91) self.Label15 = Label(top) self.Label15.place(relx=0.04, rely=0.56, height=23, width=91) self.Label15.configure(background="#0dd8bd") self.Label15.configure(disabledforeground="#a3a3a3") self.Label15.configure(font=font9) self.Label15.configure(foreground="#000000") self.Label15.configure(text='''Last Name''') self.Label15.configure(width=91) self.Label16 = Label(top) self.Label16.place(relx=0.04, rely=0.62, height=27, width=49) self.Label16.configure(background="#0dd8bd") self.Label16.configure(disabledforeground="#a3a3a3") self.Label16.configure(font=font9) self.Label16.configure(foreground="#000000") self.Label16.configure(text='''Mobile''') self.Label17 = Label(top) self.Label17.place(relx=0.04, rely=0.68, height=27, width=57) self.Label17.configure(background="#0dd8bd") self.Label17.configure(disabledforeground="#a3a3a3") self.Label17.configure(font=font9) self.Label17.configure(foreground="#000000") self.Label17.configure(text='''Address''') self.TEntry12 = ttk.Entry(top) self.TEntry12.place(relx=0.12, rely=0.5, relheight=0.03, relwidth=0.13) self.TEntry12.configure(takefocus="") self.TEntry12.configure(cursor="ibeam") self.TEntry13 = ttk.Entry(top) self.TEntry13.place(relx=0.12, rely=0.56, relheight=0.03, relwidth=0.13) self.TEntry13.configure(takefocus="") self.TEntry13.configure(cursor="ibeam") self.TEntry14 = ttk.Entry(top) self.TEntry14.place(relx=0.12, rely=0.62, relheight=0.03, relwidth=0.13) self.TEntry14.configure(takefocus="") self.TEntry14.configure(cursor="ibeam") self.TEntry15 = ttk.Entry(top) self.TEntry15.place(relx=0.12, rely=0.68, relheight=0.03, relwidth=0.13) self.TEntry15.configure(takefocus="") self.TEntry15.configure(cursor="ibeam") self.addcustomer = ttk.Button(top) self.addcustomer.place(relx=0.06, rely=0.74, height=57, width=168) self.addcustomer.configure(takefocus="") self.addcustomer.configure(text='''Add Customer''') self.addcustomer.configure(width=168) self.Label18 = Label(top) self.Label18.place(relx=0.42, rely=0.43, height=23, width=117) self.Label18.configure(background="#2fd823") self.Label18.configure(disabledforeground="#a3a3a3") self.Label18.configure(foreground="#000000") self.Label18.configure(text='''Delete Customer''') self.Label19 = Label(top) self.Label19.place(relx=0.34, rely=0.5, height=23, width=78) self.Label19.configure(background="#d9d9d9") self.Label19.configure(disabledforeground="#a3a3a3") self.Label19.configure(foreground="#000000") self.Label19.configure(text='''First Name''') self.Label20 = Label(top) self.Label20.place(relx=0.34, rely=0.56, height=23, width=77) self.Label20.configure(background="#d9d9d9") self.Label20.configure(disabledforeground="#a3a3a3") self.Label20.configure(foreground="#000000") self.Label20.configure(text='''Last Name''') self.TEntry16 = ttk.Entry(top) self.TEntry16.place(relx=0.42, rely=0.5, relheight=0.03, relwidth=0.13) self.TEntry16.configure(takefocus="") self.TEntry16.configure(cursor="ibeam") self.TEntry17 = ttk.Entry(top) self.TEntry17.place(relx=0.42, rely=0.56, relheight=0.03, relwidth=0.13) self.TEntry17.configure(takefocus="") self.TEntry17.configure(cursor="ibeam") self.deletecustomer = ttk.Button(top) self.deletecustomer.place(relx=0.37, rely=0.63, height=67, width=181) self.deletecustomer.configure(takefocus="") self.deletecustomer.configure(text='''Delete Customer''') self.deletecustomer.configure(width=181)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("600x450+660+210") top.minsize(148, 1) top.maxsize(1924, 1055) top.resizable(1, 1) top.title("GoldMiner v0.6 (Greeter)") top.configure(background="#d9d9d9") def dntStore(): username = pyip.inputStr( prompt= 'Enter Goldmine Username (Your UTEP Email without "@miners.utep.edu"): ' ) pswrd = getpass.getpass() print('Choose installed browser:\n(1) Chrome\t(2) Firefox') browsPic = pyip.inputInt() destroy_window2() def storeCreds(): destroy_window2() # os.system('python '+ os.getcwd()+'\\CED1.py') os.system(os.getcwd() + '\\CED1.exe') pswrd, username, browsPic = getCreds() self.menubar = tk.Menu(top, font="TkMenuFont", bg=_bgcolor, fg=_fgcolor) top.configure(menu=self.menubar) self.Message1 = tk.Message(top) self.Message1.place(relx=0.0, rely=-0.044, relheight=0.156, relwidth=0.693) self.Message1.configure(anchor='w') self.Message1.configure(background="#d9d9d9") self.Message1.configure( font="-family {Segoe UI} -size 14 -weight bold") self.Message1.configure(foreground="#000000") self.Message1.configure(highlightbackground="#d9d9d9") self.Message1.configure(highlightcolor="black") self.Message1.configure(text='''UTEP GoldMiner by Jorge Favela''') self.Message1.configure(width=416) self.Message2 = tk.Message(top) self.Message2.place(relx=0.017, rely=0.133, relheight=0.2, relwidth=0.893) self.Message2.configure(anchor='w') self.Message2.configure(background="#d9d9d9") self.Message2.configure(font="-family {Segoe UI} -size 12") self.Message2.configure(foreground="#000000") self.Message2.configure(highlightbackground="#d9d9d9") self.Message2.configure(highlightcolor="black") self.Message2.configure( text= '''Would you like to save time by storing your login credentials and browser preferance?''' ) self.Message2.configure(width=536) self.TButton1 = ttk.Button(top) self.TButton1.place(relx=0.267, rely=0.4, height=50, width=268) self.TButton1.configure(takefocus="") self.TButton1.configure(text='''Yes, securely store my info!''') self.TButton1.configure(command=storeCreds) self.TButton2 = ttk.Button(top) self.TButton2.place(relx=0.267, rely=0.622, height=50, width=268) self.TButton2.configure(takefocus="") self.TButton2.configure( text='''No, wipe my info when program exits.''') self.TButton2.configure(command=dntStore)
def __init__(self, l,m,name,mem,email,top,names,ratings): global dic,mod,co,wil co=0 m=dele(m)#delete previous date data dic=m #print(m) mod=len(m) '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.',background=_bgcolor) self.style.configure('.',foreground=_fgcolor) self.style.configure('.',font="TkDefaultFont") self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("1280x686+212+135") top.minsize(120, 1) top.maxsize(3004, 1913) top.resizable(1, 1) top.title("New Toplevel") top.configure(background="#000040") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="#000000") self.menubar = tk.Menu(top,font="TkMenuFont",bg=_bgcolor,fg=_fgcolor) top.configure(menu = self.menubar) self.Recommended_l = tk.Label(top) self.Recommended_l.place(relx=0.178, rely=0.131, height=48, width=240) self.Recommended_l.configure(activebackground="#f9f9f9") self.Recommended_l.configure(activeforeground="black") self.Recommended_l.configure(background="#000040") self.Recommended_l.configure(borderwidth="5") self.Recommended_l.configure(disabledforeground="#a3a3a3") self.Recommended_l.configure(font="-family {Segoe UI} -size 22") self.Recommended_l.configure(foreground="#ffffff") self.Recommended_l.configure(highlightbackground="#d9d9d9") self.Recommended_l.configure(highlightcolor="black") self.Recommended_l.configure(text="Movie : "+l[1]) self.TSeparator3 = ttk.Separator(top) self.TSeparator3.place(relx=0.165, rely=0.168, relheight=0.845) self.TSeparator3.configure(orient="vertical") self.TSeparator4 = ttk.Separator(top) self.TSeparator4.place(relx=0.818, rely=0.168, relheight=0.835) self.TSeparator4.configure(orient="vertical") self.Previous = tk.Button(top) self.Previous.place(relx=0.383, rely=0.933, height=24, width=47) self.Previous.configure(activebackground="#ececec") self.Previous.configure(activeforeground="#000000") self.Previous.configure(background="#b4eafe") self.Previous.configure(disabledforeground="#a3a3a3") self.Previous.configure(font="-family {Segoe UI} -size 15") self.Previous.configure(foreground="#000000") self.Previous.configure(highlightbackground="#d9d9d9") self.Previous.configure(highlightcolor="black") self.Previous.configure(pady="0") self.Previous.configure(text='''<''') self.Next = tk.Button(top) self.Next.place(relx=0.57, rely=0.933, height=24, width=47) self.Next.configure(activebackground="#ececec") self.Next.configure(activeforeground="#000000") self.Next.configure(background="#b4eafe") self.Next.configure(disabledforeground="#a3a3a3") self.Next.configure(font="-family {Segoe UI} -size 15") self.Next.configure(foreground="#000000") self.Next.configure(highlightbackground="#d9d9d9") self.Next.configure(highlightcolor="black") self.Next.configure(pady="0") self.Next.configure(text='''>''') self.Page_list = tk.Label(top) self.Page_list.place(relx=0.43, rely=0.933, height=21, width=164) self.Page_list.configure(activebackground="#f0f0f0f0f0f0") self.Page_list.configure(activeforeground="black") self.Page_list.configure(background="#000040") self.Page_list.configure(disabledforeground="#a3a3a3") self.Page_list.configure(font="-family {Segoe UI} -size 12") self.Page_list.configure(foreground="#b4eafe") self.Page_list.configure(highlightbackground="#d9d9d9") self.Page_list.configure(highlightcolor="black") self.Page_list.configure(text='''1 of 4''') today=date.today() g=[] for i in m: da=i.split('-') dat=date(int(da[0]),int(da[1]),int(da[2])) if(dat==today): g=m[i]#set g to curret date data das=da[2]+"/"+da[1] break if(len(g)==0):#if the movie is not been released then set g to the first show data of that movie key=next(iter(m)) #print(key) da=key.split('-') dat=date(int(da[0]),int(da[1]),int(da[2])) g=m[key] das=da[2]+"/"+da[1] #print(g) #st=today.strftime("%d")+"/"+today.strftime("%m") self.Label2 = tk.Label(top) self.Label2.place(relx=0.461, rely=0.248, height=51, width=74) self.Label2.configure(background="#000040") self.Label2.configure(disabledforeground="#a3a3a3") self.Label2.configure(font="-family {Segoe UI} -size 16") self.Label2.configure(foreground="#bbfcff") self.strd=StringVar() self.strd.set(das) self.Label2.configure(textvariable=self.strd) self.Button1 = tk.Button(top,command=lambda: self.backw(l,name,mem,email,top)) self.Button1.place(relx=0.391, rely=0.262, height=44, width=47) self.Button1.configure(activebackground="#ececec") self.Button1.configure(activeforeground="#000000") self.Button1.configure(background="#5bedf9") self.Button1.configure(disabledforeground="#a3a3a3") self.Button1.configure(font="-family {Segoe UI} -size 18") self.Button1.configure(foreground="#000000") self.Button1.configure(highlightbackground="#d9d9d9") self.Button1.configure(highlightcolor="black") self.Button1.configure(pady="0") self.Button1.configure(text='''<''') self.Button2 = tk.Button(top,command=lambda: self.ahead(l,name,mem,email,top)) self.Button2.place(relx=0.555, rely=0.262, height=44, width=47) self.Button2.configure(activebackground="#ececec") self.Button2.configure(activeforeground="#000000") self.Button2.configure(background="#5bedf9") self.Button2.configure(disabledforeground="#a3a3a3") self.Button2.configure(font="-family {Segoe UI} -size 18") self.Button2.configure(foreground="#000000") self.Button2.configure(highlightbackground="#d9d9d9") self.Button2.configure(highlightcolor="black") self.Button2.configure(pady="0") self.Button2.configure(text='''>''') dy=0.1 ty=0.364 wil=[] for i in g:#display value of the data fixed print(i) self.Movie1 = tk.Frame(top) self.Movie1.place(relx=0.18, rely=ty, relheight=0.137, relwidth=0.621) self.Movie1.configure(relief='groove') self.Movie1.configure(borderwidth="2") self.Movie1.configure(relief="groove") self.Movie1.configure(background="#00002b") self.Movie1.configure(highlightbackground="#d9d9d9") self.Movie1.configure(highlightcolor="black") wil.append(self.Movie1) self.Description1 = tk.Label(self.Movie1,wraplength=300, justify="left") self.Description1.place(relx=0.025, rely=dy, height=160, width=490) self.Description1.configure(activebackground="#f9f9f9") self.Description1.configure(activeforeground="black") self.Description1.configure(anchor='nw') self.Description1.configure(background="#00002b") self.Description1.configure(cursor="fleur") self.Description1.configure(disabledforeground="#a3a3a3") self.Description1.configure(font="-family {Segoe UI} -size 13") self.Description1.configure(foreground="#bcfbfe") self.Description1.configure(highlightbackground="#d9d9d9") self.Description1.configure(highlightcolor="black") ste="Cinema Hall : "+i[1]+"\t\tCost :"+str(i[6])+"\nAddress "+i[2]+","+i[3]+":\nTiming: "+i[5] self.Description1.configure(text=ste) wil.append(self.Description1) colo=getcolor(i[4]) self.Book_b = tk.Button(top,command=partial(slotb,l,i,i[4],name,mem,email,i[6],das,top)) self.Book_b.place(relx=0.60, rely=ty+0.02, height=54, width=177) self.Book_b.configure(activebackground="#000040") self.Book_b.configure(activeforeground="white") self.Book_b.configure(activeforeground="#ffffff") self.Book_b.configure(background=colo) self.Book_b.configure(disabledforeground="#a3a3a3") self.Book_b.configure(cursor="hand2") self.Book_b.configure(font="-family {Segoe UI} -size 14") self.Book_b.configure(foreground="#000000") self.Book_b.configure(highlightbackground="#d9d9d9") self.Book_b.configure(highlightcolor="black") self.Book_b.configure(pady="0") self.Book_b.configure(text='''Book Ticket!''') wil.append(self.Book_b) ty+=0.14 self.Fast_l = tk.Label(top) self.Fast_l.place(relx=0.18, rely=0.262, height=31, width=64) self.Fast_l.configure(activebackground="#f0f0f0f0f0f0") self.Fast_l.configure(background="#ffff80") self.Fast_l.configure(disabledforeground="#a3a3a3") self.Fast_l.configure(foreground="#000000") self.Fast_l.configure(text='''Fast Filling''') self.Sold_l = tk.Label(top) self.Sold_l.place(relx=0.242, rely=0.262, height=31, width=64) self.Sold_l.configure(activebackground="#f0f0f0f0f0f0") self.Sold_l.configure(background="#b90000") self.Sold_l.configure(disabledforeground="#a3a3a3") self.Sold_l.configure(foreground="#000000") self.Sold_l.configure(text='''Sold Out''') self.Available_f = tk.Label(top) self.Available_f.place(relx=0.305, rely=0.262, height=31, width=67) self.Available_f.configure(background="#00d200") self.Available_f.configure(disabledforeground="#a3a3a3") self.Available_f.configure(foreground="#000000") self.Available_f.configure(text='''Available''') ####################Membership Function################################################## self.membership = mem self.Membership_f = tk.LabelFrame(top) self.Membership_f.place(relx=0.013, rely=0.219, relheight=0.516, relwidth=0.14) self.Membership_f.configure(relief='groove') self.Membership_f.configure(foreground="#edea67") self.Membership_f.configure(background="#bfe2ff") self.Membership_f.configure(highlightbackground="#f3fee2") self.Membership_f.configure(highlightcolor="#4bc602") self.TSeparator3 = ttk.Separator(top) self.TSeparator3.place(relx=0.165, rely=0.168, relheight=0.845) self.TSeparator3.configure(orient="vertical") # redirect to payment def button_click(product): top.destroy() action = 1 payment.vp_start_gui_P(name, mem, product, email, action) # membership status gold, platinum, diamond = button_functionality(mem) # Gold Button prod_gold = ["Gold", 600] self.Gold_b = tk.Button(self.Membership_f, command=lambda: button_click(prod_gold)) self.Gold_b.place(relx=0.056, rely=0.734, height=84, width=157, bordermode='ignore') self.Gold_b.configure(activebackground="#f0df99") self.Gold_b.configure(activeforeground="#000000") self.Gold_b.configure(background="#ffda04") self.Gold_b.configure(borderwidth="9") self.Gold_b.configure(disabledforeground="#a3a3a3") self.Gold_b.configure(font="-family {Segoe UI} -size 15") self.Gold_b.configure(foreground="#000000") self.Gold_b.configure(highlightbackground="#d9d9d9") self.Gold_b.configure(highlightcolor="black") self.Gold_b.configure(pady="0") self.Gold_b.configure(text='Gold') if gold: self.Gold_b["state"] = "normal" else: self.Gold_b["state"] = "disabled" # Platinum Button prod_platinum = ["Platinum", 800] self.Platinum_b = tk.Button(self.Membership_f, command=lambda: button_click(prod_platinum)) self.Platinum_b.place(relx=0.056, rely=0.452, height=84, width=157, bordermode='ignore') self.Platinum_b.configure(activebackground="#707070") self.Platinum_b.configure(activeforeground="white") self.Platinum_b.configure(activeforeground="#000000") self.Platinum_b.configure(background="#d8d8d8") self.Platinum_b.configure(borderwidth="9") self.Platinum_b.configure(disabledforeground="#a3a3a3") self.Platinum_b.configure(font="-family {Segoe UI} -size 15") self.Platinum_b.configure(foreground="#000000") self.Platinum_b.configure(highlightbackground="#d9d9d9") self.Platinum_b.configure(highlightcolor="black") self.Platinum_b.configure(pady="0") self.Platinum_b.configure(text='''Platinum''') if platinum: self.Platinum_b["state"] = "normal" else: self.Platinum_b["state"] = "disabled" # Diamond Button prod_diamond = ["Diamond", 1000] self.Diamond_b = tk.Button(self.Membership_f, command=lambda: button_click(prod_diamond)) self.Diamond_b.place(relx=0.061, rely=0.169, height=84, width=157, bordermode='ignore') self.Diamond_b.configure(activebackground="#d9fcff") self.Diamond_b.configure(activeforeground="#7070fa") self.Diamond_b.configure(background="#2de9f2") self.Diamond_b.configure(borderwidth="9") self.Diamond_b.configure(disabledforeground="#a3a3a3") self.Diamond_b.configure(font="-family {Segoe UI} -size 15") self.Diamond_b.configure(foreground="#000000") self.Diamond_b.configure(highlightbackground="#d9d9d9") self.Diamond_b.configure(highlightcolor="#e9f552") self.Diamond_b.configure(highlightthickness="6") self.Diamond_b.configure(pady="0") self.Diamond_b.configure(text='''Diamond''') if diamond: self.Diamond_b["state"] = "normal" else: self.Diamond_b["state"] = "disabled" # Label in membership block self.Join_l = tk.Label(self.Membership_f) self.Join_l.place(relx=0.056, rely=0.028, height=41, width=155, bordermode='ignore') self.Join_l.configure(activebackground="#f9f9f9") self.Join_l.configure(activeforeground="black") self.Join_l.configure(background="#bfe2ff") self.Join_l.configure(disabledforeground="#a3a3a3") self.Join_l.configure(font="-family {Segoe UI} -size 12") self.Join_l.configure(foreground="#000000") self.Join_l.configure(highlightbackground="#d9d9d9") self.Join_l.configure(highlightcolor="black") self.Join_l.configure(text=f'Join our Membership plan!') self.Join_l.configure(wraplength="150") ########################################################################################################################################## ####################Sidebar######################################################################## self.TSeparator4 = ttk.Separator(top) self.TSeparator4.place(relx=0.818, rely=0.168, relheight=0.835) self.TSeparator4.configure(orient="vertical") self.Listofmovies_f = tk.LabelFrame(top) self.Listofmovies_f.place(relx=0.829, rely=0.157, relheight=0.831 , relwidth=0.138) self.Listofmovies_f.configure(relief='groove') self.Listofmovies_f.configure(font="-family {Segoe UI} -size 17") self.Listofmovies_f.configure(foreground="#000000") self.Listofmovies_f.configure(text='''List of Movies''') self.Listofmovies_f.configure(background="#d7eeff") self.Listofmovies_f.configure(highlightbackground="#f0f0f0f0f0f0") self.Listofmovies_f.configure(highlightcolor="#646464646464") self.page_id = tk.Label(self.Listofmovies_f) self.page_id.place(relx=0.04, rely=0.947, height=21, width=166 , bordermode='ignore') self.page_id.configure(activebackground="#f9f9f9") self.page_id.configure(activeforeground="black") self.page_id.configure(background="#000040") self.page_id.configure(borderwidth="10") self.page_id.configure(disabledforeground="#a3a3a3") self.page_id.configure(font="-family {Segoe UI} -size 13") self.page_id.configure(foreground="#ffffff") self.page_id.configure(highlightbackground="#d9d9d9") self.page_id.configure(highlightcolor="black") self.page_id.configure(text='''1 of 2''') namem, rating = names,ratings y=0.07 for i in range(0,len(namem)): self.Movie1_b = tk.Button(self.Listofmovies_f) self.Movie1_b.place(relx=0.056, rely=y, height=74, width=157, bordermode='ignore') self.Movie1_b.configure(activebackground="#ececec") self.Movie1_b.configure(activeforeground="#000000") self.Movie1_b.configure(anchor='nw') self.Movie1_b.configure(background="#d7eeff") self.Movie1_b.configure(disabledforeground="#a3a3a3") self.Movie1_b.configure(font="-family {Segoe UI} -size 12") self.Movie1_b.configure(foreground="#000000") self.Movie1_b.configure(highlightbackground="#d9d9d9") self.Movie1_b.configure(highlightcolor="black") self.Movie1_b.configure(pady="0") self.Movie1_b.configure(text='''{0} \n\nRating: {1}/5'''.format(namem[i],rating[i])) self.Movie1_b.configure(wraplength="150") y+=0.14 ##################################################################################################################################### #####################################HOME BAR################################################### self.Home_f = tk.LabelFrame(top) self.Home_f.place(relx=0.023, rely=0.029, relheight=0.093, relwidth=0.50) self.Home_f.configure(relief='groove') self.Home_f.configure(foreground="#000000") self.Home_f.configure(background="#e8e8ff") self.Home_f.configure(highlightbackground="#d9d9d9") self.Home_f.configure(highlightcolor="black") self.home_inner_f = tk.Frame(self.Home_f) self.home_inner_f.place(relx=0.017, rely=0.109, relheight=0.797, relwidth=0.959, bordermode='ignore') self.home_inner_f.configure(relief='groove') self.home_inner_f.configure(borderwidth="2") self.home_inner_f.configure(relief="groove") self.home_inner_f.configure(background="#b3eaff") self.home_inner_f.configure(highlightbackground="#d9d9d9") self.home_inner_f.configure(highlightcolor="black") self.Home_b = tk.Button(self.home_inner_f,command=lambda:back(name,mem,email,top)) self.Home_b.place(relx=0.025, rely=0.0, height=54, width=77) self.Home_b.configure(activebackground="#ececec") self.Home_b.configure(activeforeground="#000000") self.Home_b.configure(background="#000040") self.Home_b.configure(disabledforeground="#a3a3a3") self.Home_b.configure(font="-family {Segoe UI} -size 12") self.Home_b.configure(foreground="#ffffff") self.Home_b.configure(highlightbackground="#d9d9d9") self.Home_b.configure(highlightcolor="black") self.Home_b.configure(pady="0") self.Home_b.configure(text='''Home''') self.Member_l = tk.Label(self.home_inner_f) self.Member_l.place(relx=0.262, rely=0.137, height=34, width=352) self.Member_l.configure(activebackground="#b3eaff") self.Member_l.configure(activeforeground="black") self.Member_l.configure(background="#b3eaff") self.Member_l.configure(disabledforeground="#a3a3a3") self.Member_l.configure(font="-family {Segoe UI} -size 12") self.Member_l.configure(foreground="#000000") self.Member_l.configure(highlightbackground="#d9d9d9") self.Member_l.configure(highlightcolor="black") self.Member_l.configure(text=f'Member status {name} has {mem} Membership')
def launch_client(self): self.host = self.host_entry.get() self.port = 15000 self.nick = self.nick_entry.get() self.host_entry_label.destroy() self.host_entry.destroy() self.nick_entry_label.destroy() self.nick_entry.destroy() self.launch_button.destroy() self.frame.pack_forget() self.title('ChatUp Client: {0}'.format(self.nick)) self.should_quit = False self.protocol('WM_DELETE_WINDOW', self.client_quit) self.chat_frame = ttk.Frame(self.frame, borderwidth = 5) self.clients_frame = ttk.Frame(self.frame) self.entry_frame = ttk.Frame(self) self.chat_frame.style = ttk.Style() self.chat_frame.style.theme_use(self.theme_use) self.clients_frame.style = ttk.Style() self.clients_frame.style.theme_use(self.theme_use) self.entry_frame.style = ttk.Style() self.entry_frame.style.theme_use(self.theme_use) self.chat_text = Tkinter.Text(self.chat_frame, state = Tkinter.DISABLED) self.chat_entry = ttk.Entry(self.entry_frame) self.send_button = ttk.Button(self.entry_frame, text = 'Send') self.send_button.bind('<Button-1>', self.send) self.chat_entry.bind('<Return>', self.send) self.entry_frame.pack(side = Tkinter.BOTTOM, fill = Tkinter.X) self.frame.pack(side = Tkinter.TOP, fill = Tkinter.BOTH, expand = True) self.clients_frame.pack(side = Tkinter.LEFT, fill = Tkinter.BOTH, expand = True) self.chat_frame.pack(side = Tkinter.RIGHT, fill = Tkinter.BOTH, expand = True) self.chat_entry.pack(side = Tkinter.LEFT, fill = Tkinter.X, expand = True) self.send_button.pack(side = Tkinter.RIGHT) self.client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.client_socket.connect((self.host, self.port)) self.client_socket.send('Please allow connection!%&%{0}%&%'.format(self.nick)) self.clients = ast.literal_eval(self.client_socket.recv(1024)[11 : ]) self.dest = Tkinter.StringVar() self.radios = [] self.radio_label = ttk.Label(self.clients_frame, width = 15, wraplength = 125, anchor = Tkinter.W, justify = Tkinter.LEFT, text = 'Choose reciever from the following connected clients:') self.radio_label.pack() self.chat_text.pack(fill = Tkinter.BOTH, expand = True) self.__i = 0 self.__j = 1 for client in self.clients: r = ttk.Radiobutton(self.clients_frame, text = client, variable = self.dest, value = client) r.pack(anchor = Tkinter.W) self.radios.append(r) self.dest.set(self.clients[0]) self.chat_entry.focus_set() self.clientd_thread = threading.Thread(name = 'clientd', target = self.clientd) self.clientd_thread.start()
def gui_init(self): frame_up = Frame( self.root, cursor='hand1', bg=self.color, width=self.width, height=self.height * 1 / 12) frame_up.grid_propagate(0) frame_up.pack(side=TOP, expand=True, fill=BOTH) frame_middle = Frame( self.root, cursor='hand1', bg=self.color, width=self.width, height=self.height * 10 / 12) frame_middle.grid_propagate(0) frame_middle.pack(side=TOP, expand=True, fill=BOTH) frame_down = Frame( self.root, cursor='hand1', bg=self.color, width=self.width, height=self.height * 1 / 12) frame_down.grid_propagate(0) frame_down.pack(side=TOP, expand=True, fill=BOTH) self.uploadedFilesLabel = Label( frame_up, text="BuyedBooks", font=self.font, bg=self.color) self.uploadedFilesLabel.place(relx=0.5, rely=0.5, anchor='center') self.booksDisplay = ttk.Treeview( frame_middle, columns=('#1', '#2', '#3', '#4', '#5'), height=20, show='headings', padding=(1, 1, 1, 1)) self.booksDisplay.heading('#1', text='Title') self.booksDisplay.heading('#2', text='Author') self.booksDisplay.heading('#3', text='Genre') self.booksDisplay.heading('#4', text='Quantity') self.booksDisplay.heading('#5', text='Review Score') self.booksDisplay.column('#1', stretch=True, width=self.width / 5) self.booksDisplay.column('#2', stretch=True, width=self.width / 5) self.booksDisplay.column('#3', stretch=True, width=self.width / 5) self.booksDisplay.column('#4', stretch=True, width=self.width / 5) self.booksDisplay.column('#5', stretch=True, width=self.width / 5) self.booksDisplay.pack(side=TOP, fill=BOTH, expand=True) #self.booksDisplay.grid(row=5, columnspan=4, sticky='nw') #self.booksDisplay.place(relx=0.5, rely=0.5, anchor='center') self.booksDisplayStyle = ttk.Style() self.booksDisplayStyle.configure( "Treeview", font=self.font, rowheight=50) self.booksDisplayStyle.configure("Treeview.Heading", font=self.font) #bind treeview to mouse click self.booksDisplay.bind("<ButtonRelease-1>", self.__bookInfo) self.booksDisplay.tag_configure( "tagBook", background="white", foreground="red", font=self.font) self.addNewBookButton = Button( frame_down, text="Buy new book", font=self.font) self.addNewBookButton.place(relx=0.5, rely=0.5, anchor='center') self.addNewBookButton.bind("<Button-1>", self.__buyNewBook) self.__display_availableBooks()
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#d9d9d9' # X11 color: 'gray85' font11 = "-family {French Script MT} -size 28 -weight bold " \ "-slant roman -underline 0 -overstrike 0" font16 = "-family Lemon -size 24 -weight normal -slant roman " \ "-underline 0 -overstrike 0" font17 = "-family Gabriola -size 28 -weight bold -slant roman " \ "-underline 0 -overstrike 0" font21 = "-family MingLiU-ExtB -size 15 -weight bold -slant " \ "roman -underline 1 -overstrike 0" font23 = "-family {Comic Sans MS} -size 14 -weight normal " \ "-slant roman -underline 0 -overstrike 0" font9 = "-family {Russo One} -size 14 -weight normal -slant " \ "roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("1168x950+375+0") top.title("MASTER CHEF") top.configure(background="#fffcb0") self.Frame1 = tk.Frame(top) self.Frame1.place(relx=0.257, rely=0.189, relheight=0.574, relwidth=0.638) self.Frame1.configure(relief='groove') self.Frame1.configure(borderwidth="2") self.Frame1.configure(relief='groove') self.Frame1.configure(background="#04091c") self.Frame1.configure(width=745) self.fra43_lab44 = tk.Label(self.Frame1) self.fra43_lab44.place(relx=0.027, rely=0.349, height=36, width=182) self.fra43_lab44.configure(background="#b5d8a4") self.fra43_lab44.configure(disabledforeground="#a3a3a3") self.fra43_lab44.configure(font=font9) self.fra43_lab44.configure(foreground="#000000") self.fra43_lab44.configure(text='''Ingredient 1''') self.fra43_lab44.configure(width=182) self.Label1 = tk.Label(self.Frame1) self.Label1.place(relx=0.027, rely=0.532, height=36, width=182) self.Label1.configure(background="#ceefa7") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(font=font9) self.Label1.configure(foreground="#000000") self.Label1.configure(text='''Ingredient 2''') self.Label1.configure(width=182) self.Label2 = tk.Label(self.Frame1) self.Label2.place(relx=0.027, rely=0.697, height=36, width=182) self.Label2.configure(background="#bfd8a2") self.Label2.configure(disabledforeground="#a3a3a3") self.Label2.configure(font=font9) self.Label2.configure(foreground="#000000") self.Label2.configure(text='''Ingredient 3''') self.Label2.configure(width=182) def callback(): con2(z) button1() f = list() def returndish(event): f.append(self.TCombobox4.get()) print(f) def button1(): dish.append('select') k = tuple(dish) li = len(dish) - 1 self.TCombobox4['values'] = k self.TCombobox4.current(li) self.TCombobox4.bind("<<ComboboxSelected>>", returndish) self.Button1 = tk.Button(self.Frame1) self.Button1.place(relx=0.04, rely=0.862, height=53, width=386) self.Button1.configure(activebackground="#d9d9d9") self.Button1.configure(activeforeground="#ffffff") self.Button1.configure(background="#d81623") self.Button1.configure(disabledforeground="#a3a3a3") self.Button1.configure(font=font17) self.Button1.configure(foreground="#ffffff") self.Button1.configure(highlightbackground="#d9d9d9") self.Button1.configure(highlightcolor="black") self.Button1.configure(pady="0") self.Button1.configure(text='''|| Ingest Ingredients :) ||''') self.Button1.configure(width=386) self.Button1.config(command=callback) self.Label5 = tk.Label(self.Frame1) self.Label5.place(relx=0.04, rely=0.073, height=86, width=362) self.Label5.configure(background="#87ffeb") self.Label5.configure(disabledforeground="#a3a3a3") self.Label5.configure(font=font11) self.Label5.configure(foreground="#000000") self.Label5.configure(relief='raised') self.Label5.configure(text='''What do you have ??''') self.Label5.configure(width=362) z = list() def lcon(k): z.append(k) print(z) def callbackFunc(event): sel1 = list() print("New Element Selected") #print(self.TCombobox1.get()) sel1.append(self.TCombobox1.get()) print(sel1) k = ''.join(sel1) lcon(k) def callbackFunc2(event): sel2 = list() print("New Element Selected") # print(self.TCombobox1.get()) sel2.append(self.TCombobox2.get()) print(sel2) k = ''.join(sel2) lcon(k) def callbackFunc3(event): sel3 = list() print("New Element Selected") # print(self.TCombobox1.get()) sel3.append(self.TCombobox3.get()) print(sel3) k = ''.join(sel3) lcon(k) self.TCombobox1 = ttk.Combobox(self.Frame1) self.TCombobox1.place(relx=0.309, rely=0.349, relheight=0.066, relwidth=0.264) #self.TCombobox1.configure(textvariable=NewGUI_support.combobox) self.TCombobox1.configure(width=197) self.TCombobox1.configure(takefocus="") m1 = list() m1 = con() m1.append("select") ll1 = len(m1) - 1 m1 = tuple(m1) self.TCombobox1['values'] = m1 self.TCombobox1.current(ll1) self.TCombobox1.bind("<<ComboboxSelected>>", callbackFunc) self.TCombobox2 = ttk.Combobox(self.Frame1) self.TCombobox2.place(relx=0.309, rely=0.532, relheight=0.066, relwidth=0.264) #self.TCombobox2.configure(textvariable=NewGUI_support.combobox) self.TCombobox2.configure(width=197) self.TCombobox2.configure(takefocus="") m2 = list() m2 = con() m2.append("select") ll2 = len(m2) - 1 m2 = tuple(m2) self.TCombobox2['values'] = m2 self.TCombobox2.current(ll2) self.TCombobox2.bind("<<ComboboxSelected>>", callbackFunc2) self.TCombobox3 = ttk.Combobox(self.Frame1) self.TCombobox3.place(relx=0.309, rely=0.697, relheight=0.066, relwidth=0.264) #self.TCombobox3.configure(textvariable=NewGUI_support.combobox) self.TCombobox3.configure(width=197) self.TCombobox3.configure(takefocus="") m3 = list() m3 = con() m3.append("select") ll3 = len(m3) - 1 m3 = tuple(m3) self.TCombobox3['values'] = m3 self.TCombobox3.current(ll3) self.TCombobox3.bind("<<ComboboxSelected>>", callbackFunc3) self.Label3 = tk.Label(self.Frame1) self.Label3.place(relx=0.644, rely=0.055, height=186, width=252) self.Label3.configure(background="#d9d9d9") self.Label3.configure(disabledforeground="#a3a3a3") self.Label3.configure(foreground="#000000") self._img1 = tk.PhotoImage( file= "C:/Users/Sumit Mehta/Desktop/CSE 3/PROJECT/Images_required/download (1).png" ) self.Label3.configure(image=self._img1) self.Label3.configure(text='''Label''') self.Label3.configure(width=252) self.Label4 = tk.Label(self.Frame1) self.Label4.place(relx=0.617, rely=0.477, height=176, width=272) self.Label4.configure(background="#d9d9d9") self.Label4.configure(disabledforeground="#a3a3a3") self.Label4.configure(foreground="#000000") self._img2 = tk.PhotoImage( file= "C:/Users/Sumit Mehta/Desktop/CSE 3/PROJECT/Images_required/rsz_1rsz_curry-05.png" ) self.Label4.configure(image=self._img2) self.Label4.configure(text='''Label''') self.Label4.configure(width=272) self.Label7 = tk.Label(top) self.Label7.place(relx=0.223, rely=0.042, height=116, width=792) self.Label7.configure(background="#5e051a") self.Label7.configure(disabledforeground="#a3a3a3") self.Label7.configure(font=font16) self.Label7.configure(foreground="#ffffff") self.Label7.configure(text='''THE BELLY RULES THE MIND !! *_*''') self.Label7.configure(width=792) self.Label6 = tk.Label(top) self.Label6.place(relx=0.026, rely=0.021, height=156, width=172) self.Label6.configure(background="#d9d9d9") self.Label6.configure(disabledforeground="#a3a3a3") self.Label6.configure(foreground="#000000") self._img3 = tk.PhotoImage( file= "C:/Users/Sumit Mehta/Desktop/CSE 3/PROJECT/Images_required/master-chef-stamp-clipart__k18629513.png" ) self.Label6.configure(image=self._img3) self.Label6.configure(text='''Label''') self.Label6.configure(width=172) self.Label8 = tk.Label(top) self.Label8.place(relx=0.009, rely=0.305, height=336, width=282) self.Label8.configure(background="#d9d9d9") self.Label8.configure(disabledforeground="#a3a3a3") self.Label8.configure(foreground="#000000") self._img4 = tk.PhotoImage( file= "C:/Users/Sumit Mehta/Desktop/CSE 3/PROJECT/Images_required/personagem-de-desenho-animado-sorridente_8250-10.png" ) self.Label8.configure(image=self._img4) self.Label8.configure(text='''Label''') self.Label8.configure(width=282) self.Labelframe1 = tk.LabelFrame(top) self.Labelframe1.place(relx=0.257, rely=0.789, relheight=0.195, relwidth=0.634) self.Labelframe1.configure(relief='sunken') self.Labelframe1.configure(font=font21) self.Labelframe1.configure(foreground="#f0fff0") self.Labelframe1.configure(relief='sunken') self.Labelframe1.configure(text='''RECIPES FOUND''') self.Labelframe1.configure(background="#2b1121") self.Labelframe1.configure(highlightcolor="#0e1f63") self.Labelframe1.configure(width=740) self.TCombobox4 = ttk.Combobox(self.Labelframe1) self.TCombobox4.place(relx=0.027, rely=0.27, relheight=0.195, relwidth=0.834, bordermode='ignore') #self.TCombobox4.configure(textvariable=NewGUI_support.combobox) self.TCombobox4.configure(width=617) self.TCombobox4.configure(takefocus="") def webpage(): webp(f) self.Button2 = tk.Button(self.Labelframe1) self.Button2.place(relx=0.176, rely=0.595, height=43, width=396, bordermode='ignore') self.Button2.configure(activebackground="#d9d9d9") self.Button2.configure(activeforeground="#000000") self.Button2.configure(background="#020811") self.Button2.configure(disabledforeground="#a3a3a3") self.Button2.configure(font=font23) self.Button2.configure(foreground="#ffffff") self.Button2.configure(highlightbackground="#d9d9d9") self.Button2.configure(highlightcolor="black") self.Button2.configure(pady="0") self.Button2.configure(text='''SHOW PROCEDURE''') self.Button2.configure(width=396) self.Button2.config(command=webpage)
def __init__(self, top=None): #self.colorflag=0 '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.fcan = 2000 self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("1863x1050+57+24") top.minsize(1, 1) top.maxsize(1905, 1050) top.resizable(1, 1) top.title("QuadDrop") top.configure(highlightcolor="black") self.StatusMesaageFrame = ttk.Labelframe(top) self.StatusMesaageFrame.place(relx=0.016, rely=0.629, relheight=0.31, relwidth=0.499) self.StatusMesaageFrame.configure(relief='') self.StatusMesaageFrame.configure(text='''Status Messages''') self.StatusMesaages = tk.Text(self.StatusMesaageFrame) self.StatusMesaages.place(relx=0.022, rely=0.064, relheight=0.887, relwidth=0.957, bordermode='ignore') self.StatusMesaages.configure(background="#000000") self.StatusMesaages.configure(blockcursor="1") self.StatusMesaages.configure(cursor="arrow") self.StatusMesaages.configure(exportselection="0") self.StatusMesaages.configure(font="-family {Ubuntu} -size 13") self.StatusMesaages.configure(foreground="white") self.StatusMesaages.configure(selectbackground="#c4c4c4") self.StatusMesaages.configure(state='disabled') self.StatusMesaages.configure(wrap="word") #ScrollBar Functionality self.vsb = tk.Scrollbar(self.StatusMesaageFrame, orient="vertical", command=self.StatusMesaages.yview) self.StatusMesaages.configure(yscrollcommand=self.vsb.set) self.vsb.pack(side="right", fill="y") self.StatusMesaages.pack(side="left", fill="both", expand=True) self.style.configure('TNotebook.Tab', background=_bgcolor) self.style.configure('TNotebook.Tab', foreground=_fgcolor) self.style.map('TNotebook.Tab', background=[('selected', _compcolor), ('active', _ana2color)]) self.TNotebook1 = ttk.Notebook(top) self.TNotebook1.place(relx=0.526, rely=0.515, relheight=0.422, relwidth=0.463) self.TNotebook1.configure(takefocus="") self.DeliveryDetailsPage = tk.Frame(self.TNotebook1) self.TNotebook1.add(self.DeliveryDetailsPage, padding=3) self.TNotebook1.tab( 0, text="Delivery Details", compound="left", underline="-1", ) self.DroneFlightDataPage = tk.Frame(self.TNotebook1) self.TNotebook1.add(self.DroneFlightDataPage, padding=3) self.TNotebook1.tab( 1, text="Drone Flight Data", compound="left", underline="-1", ) self.AboutPage = tk.Frame(self.TNotebook1) self.TNotebook1.add(self.AboutPage, padding=3) self.TNotebook1.tab( 2, text="About", compound="none", underline="-1", ) self.CreditsPage = tk.Frame(self.TNotebook1) self.TNotebook1.add(self.CreditsPage, padding=3) self.TNotebook1.tab( 3, text="Credits", compound="none", underline="-1", ) self.CreditsPage.configure(cursor="heart") self.TSeparator1 = ttk.Separator(self.DeliveryDetailsPage) self.TSeparator1.place(relx=0.298, rely=0.048, relheight=0.905) self.TSeparator1.configure(orient="vertical") self.DeliveryList = tk.Listbox(self.DeliveryDetailsPage) self.DeliveryList.place(relx=0.023, rely=0.048, relheight=0.914, relwidth=0.26) self.DeliveryList.configure(background="white") self.DeliveryList.configure(font="TkFixedFont 11") self.DeliveryList.configure(selectbackground="#c4c4c4") self.DeliveryList.bind('<<ListboxSelect>>', QuadDrop_support.delidetails) self.DeliveryDetails = tk.Text(self.DeliveryDetailsPage) self.DeliveryDetails.place(relx=0.314, rely=0.05, relheight=0.907, relwidth=0.67) self.DeliveryDetails.configure(background="white") self.DeliveryDetails.configure(blockcursor="1") self.DeliveryDetails.configure(cursor="arrow") self.DeliveryDetails.configure(exportselection="0") self.DeliveryDetails.configure(font="TkTextFont 11") self.DeliveryDetails.configure(selectbackground="#c4c4c4") self.DeliveryDetails.configure(state='disabled') self.DeliveryDetails.configure(wrap="word") self.WhyconCoordsFrame = ttk.Labelframe(self.DroneFlightDataPage) self.WhyconCoordsFrame.place(relx=0.012, rely=0.024, relheight=0.298, relwidth=0.974) self.WhyconCoordsFrame.configure(relief='') self.WhyconCoordsFrame.configure(text='''Whycon Coordinates''') self.WhyconCoords = tk.Text(self.WhyconCoordsFrame) self.WhyconCoords.place(relx=0.012, rely=0.164, relheight=0.754, relwidth=0.976, bordermode='ignore') self.WhyconCoords.configure(background="white") self.WhyconCoords.configure(blockcursor="1") self.WhyconCoords.configure(cursor="arrow") self.WhyconCoords.configure(font="TkTextFont") self.WhyconCoords.configure(selectbackground="#c4c4c4") self.WhyconCoords.configure(state='disabled') self.WhyconCoords.configure(wrap="word") self.Canvas3 = tk.Canvas(self.DroneFlightDataPage) self.Canvas3.place(relx=0.488, rely=0.349, relheight=0.617, relwidth=0.501) self.Canvas3.configure(borderwidth="2") self.Canvas3.configure(relief="ridge") self.Canvas3.configure(selectbackground="#c4c4c4") self.FlightData = tk.Text(self.Canvas3) self.FlightData.place(relx=0.0, rely=0.0, relheight=0.996, relwidth=1.012) self.FlightData.configure(background="white") self.FlightData.configure(cursor="arrow") self.FlightData.configure(font="TkTextFont") self.FlightData.configure(selectbackground="#c4c4c4") self.FlightData.configure(state='disabled') self.FlightData.configure(wrap="word") self.DroneFlightDataFrame = ttk.Labelframe(self.DroneFlightDataPage) self.DroneFlightDataFrame.place(relx=0.012, rely=0.341, relheight=0.622, relwidth=0.466) self.DroneFlightDataFrame.configure(relief='') self.DroneFlightDataFrame.configure(text='''Drone Flight Data''') self.mvo = tk.Text(self.DroneFlightDataFrame) self.mvo.place(relx=0.025, rely=0.078, relheight=0.439, relwidth=0.938, bordermode='ignore') self.mvo.configure(background="#ffffff") self.mvo.configure(borderwidth="0") self.mvo.configure(cursor="arrow") self.mvo.configure(font="TkTextFont") self.mvo.configure(selectbackground="#c4c4c4") self.mvo.configure(state='disabled') self.mvo.configure(wrap="word") self.imu = tk.Text(self.DroneFlightDataFrame) self.imu.place(relx=0.025, rely=0.51, relheight=0.439, relwidth=0.938, bordermode='ignore') self.imu.configure(background="#ffffff") self.imu.configure(borderwidth="0") self.imu.configure(cursor="arrow") self.imu.configure(font="TkTextFont") self.imu.configure(selectbackground="#c4c4c4") self.imu.configure(state='disabled') self.imu.configure(wrap="word") self.XYPositionalDataFrame = ttk.Labelframe(top) self.XYPositionalDataFrame.place(relx=0.016, rely=0.057, relheight=0.558, relwidth=0.499) self.XYPositionalDataFrame.configure(relief='') self.XYPositionalDataFrame.configure(text='''XY Positional Data''') self.Scale = ttk.Scale(self.XYPositionalDataFrame, from_=0, to=4, style='sc.Horizontal.TScale') self.Scale.place(relx=0.022, rely=0.947, relwidth=0.958, relheight=0.0, height=17, bordermode='ignore') self.Scale.configure(takefocus="") self.Scale.configure(cursor="sb_h_double_arrow") #self.style.configure('sc.Horizontal.TScale',tickinterval=10) self.sca = 100 self.zmm = self.sca / 2 #self.Scale.configure(variable=self.sca) self.Scale.set(2) self.Scale.configure(command=self.zoomer) #self.sca=tk.IntVar() self.XYPositionalData = tk.Canvas(self.XYPositionalDataFrame) self.XYPositionalData.place(relx=0.022, rely=0.051, relheight=0.86, relwidth=0.959, bordermode='ignore') #self.XYPositionalData.configure(borderwidth="2") self.XYPositionalData.configure(cursor="crosshair") self.XYPositionalData.configure(relief="ridge") self.XYPositionalData.configure(background="#ffffff") #self.scale=100 self.XYPositionalData.configure(scrollregion=(0, 0, self.fcan, self.fcan)) self.XYPositionalData.bind('<Configure>', QuadDrop_support.create_grid) self.XNos = tk.Canvas(self.XYPositionalDataFrame) self.XNos.place(relx=0.022, rely=0.051, relheight=0.04, relwidth=0.959, bordermode='ignore') self.XNos.configure(background="#ffffff") self.XNos.bind('<Configure>', QuadDrop_support.create_nos) self.XNos.configure(scrollregion=(0, 0, self.fcan, 25)) self.YNos = tk.Canvas(self.XYPositionalDataFrame) self.YNos.place(relx=0.022, rely=0.051, relheight=0.86, relwidth=0.023, bordermode='ignore') self.YNos.configure(background="#ffffff") self.YNos.bind('<Configure>', QuadDrop_support.create_nos) self.YNos.configure(scrollregion=(0, 0, 25, self.fcan)) #self.xsb.grid(row=1, column=0, sticky="ew") #self.ysb.grid(row=0, column=1, sticky="ns") #self.XYPositionalData.grid(row=200, column=200, sticky="nsew") #self.grid_rowconfigure(0, weight=1) #self.grid_columnconfigure(0, weight=1) self.XNos.bind("<ButtonPress-1>", self.scroll_start) self.XNos.bind("<B1-Motion>", self.scroll_move) self.YNos.bind("<ButtonPress-1>", self.scroll_start) self.YNos.bind("<B1-Motion>", self.scroll_move) self.XYPositionalData.bind("<ButtonPress-1>", self.scroll_start) self.XYPositionalData.bind("<B1-Motion>", self.scroll_move) #self.XYPositionalData.bind("<Button-4>", self.zoomerP) #self.XYPositionalData.bind("<Button-5>", self.zoomerM) self.XYPositionalData.xview_moveto(0.3) self.XNos.xview_moveto(0.3) self.XYPositionalData.yview_moveto(0.37) self.YNos.yview_moveto(0.37) self.Progressbar = ttk.Progressbar(top, style="Horizontal.TProgressbar") self.Progressbar.place(relx=0.236, rely=0.957, relwidth=0.733, relheight=0.0, height=20) self.Progressbar.configure(length="1365") self.Progressbar.configure(value="0") self.Hud = ttk.Frame(top) self.Hud.place(relx=0.907, rely=0.067, relheight=0.433, relwidth=0.083) self.Hud.configure(relief='groove') self.Hud.configure(borderwidth="2") self.Hud.configure(relief="groove") self.Hud.configure(cursor="arrow") self.StatusLabel = ttk.Label(self.Hud) self.StatusLabel.place(relx=0.065, rely=0.022, height=16, width=49) self.StatusLabel.configure(background="#d9d9d9") self.StatusLabel.configure(foreground="#000000") self.StatusLabel.configure(font="TkDefaultFont") self.StatusLabel.configure(relief="flat") self.StatusLabel.configure(anchor='w') self.StatusLabel.configure(justify='left') self.StatusLabel.configure(text='''Status :''') self.Status = ttk.Label(self.Hud) self.Status.place(relx=0.455, rely=0.022, height=16, width=67) self.Status.configure(background="#d9d9d9") #self.Status.configure(foreground="#2cbc00") self.Status.configure(font="TkDefaultFont") self.Status.configure(relief="flat") self.Status.configure(anchor='w') self.Status.configure(justify='left') self.BatteryLabel = ttk.Label(self.Hud) self.BatteryLabel.place(relx=0.065, rely=0.11, height=16, width=59) self.BatteryLabel.configure(background="#d9d9d9") self.BatteryLabel.configure(foreground="#000000") self.BatteryLabel.configure(font="TkDefaultFont") self.BatteryLabel.configure(relief="flat") self.BatteryLabel.configure(anchor='w') self.BatteryLabel.configure(justify='left') self.BatteryLabel.configure(text='''Battery :''') self.WifiLabel = ttk.Label(self.Hud) self.WifiLabel.place(relx=0.065, rely=0.066, height=16, width=64) self.WifiLabel.configure(background="#d9d9d9") self.WifiLabel.configure(foreground="#000000") self.WifiLabel.configure(font="TkDefaultFont") self.WifiLabel.configure(relief="flat") self.WifiLabel.configure(anchor='w') self.WifiLabel.configure(justify='left') self.WifiLabel.configure(text='''Wifi :''') self.Battery = ttk.Progressbar(self.Hud, style="batt.Horizontal.TProgressbar") self.Battery.place(relx=0.455, rely=0.112, relwidth=0.39, relheight=0.0, height=14) self.Battery.configure(length="60") self.Battery.configure(value="69.0") self.AltitudeBar = ttk.Progressbar(self.Hud, style="Horizontal.TProgressbar") self.AltitudeBar.place(relx=0.195, rely=0.262, relwidth=0.195, relheight=0.0, height=296) self.AltitudeBar.configure(orient="vertical") self.AltitudeBar.configure(length="90") self.AltitudeBar.configure(value="70.2") self.SpeedBar = ttk.Progressbar(self.Hud, style="Horizontal.TProgressbar") self.SpeedBar.place(relx=0.578, rely=0.262, relwidth=0.195, relheight=0.0, height=296) self.SpeedBar.configure(orient="vertical") self.SpeedBar.configure(length="90") self.SpeedBar.configure(value="30") self.AltitudeLabel = ttk.Label(self.Hud) self.AltitudeLabel.place(relx=0.13, rely=0.934, height=16, width=57) self.AltitudeLabel.configure(background="#d9d9d9") self.AltitudeLabel.configure(foreground="#000000") self.AltitudeLabel.configure(font="TkDefaultFont") self.AltitudeLabel.configure(relief="flat") self.AltitudeLabel.configure(anchor='w') self.AltitudeLabel.configure(justify='left') self.AltitudeLabel.configure(takefocus="Altitude") self.AltitudeLabel.configure(text='''Altitude''') self.SpeedLabel = ttk.Label(self.Hud) self.SpeedLabel.place(relx=0.558, rely=0.934, height=16, width=47) self.SpeedLabel.configure(background="#d9d9d9") self.SpeedLabel.configure(foreground="#000000") self.SpeedLabel.configure(font="TkDefaultFont") self.SpeedLabel.configure(relief="flat") self.SpeedLabel.configure(anchor='w') self.SpeedLabel.configure(justify='left') self.SpeedLabel.configure(takefocus="Altitude") self.SpeedLabel.configure(text='''Speed''') self.ModeLabel = ttk.Label(self.Hud) self.ModeLabel.place(relx=0.065, rely=0.152, height=16, width=47) self.ModeLabel.configure(background="#d9d9d9") self.ModeLabel.configure(foreground="#000000") self.ModeLabel.configure(font="TkDefaultFont") self.ModeLabel.configure(relief="flat") self.ModeLabel.configure(anchor='w') self.ModeLabel.configure(justify='left') self.ModeLabel.configure(text='''Mode :''') self.Mode = ttk.Label(self.Hud) self.Mode.place(relx=0.455, rely=0.154, height=16, width=67) self.Mode.configure(background="#d9d9d9") self.Mode.configure(foreground="#000000") self.Mode.configure(font="TkDefaultFont") self.Mode.configure(relief="flat") self.Mode.configure(anchor='w') self.Mode.configure(justify='left') self.Mode.configure(text='''Normal''') self.Wifi = ttk.Label(self.Hud) self.Wifi.place(relx=0.455, rely=0.066, height=17, width=40) self.Wifi.configure(background="#d9d9d9") self.Wifi.configure(foreground="#000000") self.Wifi.configure(font="TkDefaultFont") self.Wifi.configure(relief="flat") self.Wifi.configure(anchor='w') self.Wifi.configure(justify='left') self.Wifi.configure(text='''50%''') self.Wifi.configure(cursor="fleur") self.Altitude = ttk.Label(self.Hud) self.Altitude.place(relx=0.195, rely=0.213, height=16, width=30) self.Altitude.configure(background="#d9d9d9") self.Altitude.configure(foreground="#000000") self.Altitude.configure(font="TkDefaultFont") self.Altitude.configure(relief="flat") self.Altitude.configure(anchor='w') self.Altitude.configure(justify='left') self.Altitude.configure(text='''70.2''') self.Speed = ttk.Label(self.Hud) self.Speed.place(relx=0.578, rely=0.213, height=16, width=30) self.Speed.configure(background="#d9d9d9") self.Speed.configure(foreground="#000000") self.Speed.configure(font="TkDefaultFont") self.Speed.configure(relief="flat") self.Speed.configure(anchor='w') self.Speed.configure(justify='left') self.Speed.configure(text='''70.2''') self.EmStopButton = tk.Button(top) self.EmStopButton.place(relx=0.032, rely=0.952, height=28, width=169) self.EmStopButton.configure(activebackground="#ff4545") self.EmStopButton.configure(activeforeground="white") self.EmStopButton.configure(background="#ff2424") self.EmStopButton.configure(cursor="hand1") self.EmStopButton.configure(state='disabled') self.EmStopButton.configure(command=QuadDrop_support.emstop) self.EmStopButton.configure(text='''Emergency Stop''') self.Logo = tk.Label(top) self.Logo.place(relx=0.011, rely=0.003, height=50, width=200) self.Logo.configure(activebackground="#f9f9f9") self.Logo.configure(cursor="heart") self.Logo.configure(font="-family {Ubuntu} -size 24") self.Logo.configure(text='''QuadDrop''') self.DroneLiveFeedFrame = ttk.Labelframe(top) self.DroneLiveFeedFrame.place(relx=0.527, rely=0.058, relheight=0.443, relwidth=0.372) self.DroneLiveFeedFrame.configure(relief='') self.DroneLiveFeedFrame.configure(text='''Drone Live Feed''') self.DroneLiveFeed = tk.Label(self.DroneLiveFeedFrame) self.DroneLiveFeed.place(relx=0.029, rely=0.066, height=405, width=656, bordermode='ignore') #photo_location = os.path.join(prog_location,"../../TelloPy/files/joystick_and_video.png") #global _img0 #_img0 = tk.PhotoImage(file=photo_location) #self.DroneLiveFeed.configure(image=_img0) self.StartButton = tk.Button(top) self.StartButton.place(relx=0.886, rely=0.019, height=28, width=189) self.StartButton.configure(activebackground="#45ed61") self.StartButton.configure(activeforeground="#ffffff") self.StartButton.configure(cursor="hand1") self.StartButton.configure(command=QuadDrop_support.start) self.StartButton.configure(text='''Start''') self.ConnectButton = tk.Button(top) self.ConnectButton.place(relx=0.886, rely=0.019, height=28, width=189) self.ConnectButton.configure(activebackground="#f9f9f9") self.ConnectButton.configure(command=QuadDrop_support.conn) self.ConnectButton.configure(text='''Connect''') self.EmLock = tk.Checkbutton(top) self.EmLock.place(relx=0.016, rely=0.955, relheight=0.019, relwidth=0.013) self.EmLock.configure(activebackground="#f9f9f9") self.EmLock.configure(justify='left', bd=0) self.EmLock.configure(command=QuadDrop_support.disable_enable_button) self.EmLock.configure(variable=QuadDrop_support.che48) self.Error = tk.Label(top) self.Error.place(relx=0.693, rely=0.025, height=18, width=337) self.Error.configure(anchor='e') self.Error.configure(foreground="#d9d9d9") self.Error.configure(text='''Connection Error ! Try Again''') self.AboutSlide = tk.Label(self.AboutPage) self.AboutSlide.place(relx=0.5, rely=0.5, height=408, width=857, anchor="center") self.AboutSlide.configure(relief="flat", borderwidth="0") self.CreditsSlide = tk.Label(self.CreditsPage) self.CreditsSlide.place(relx=0.5, rely=0.5, height=408, width=857, anchor="center") self.CreditsSlide.configure(relief="flat", borderwidth="0") #self.Error.place_forget() self.CallbackButton = tk.Button(top) self.CallbackButton.place(relx=0.134, rely=0.952, height=28, width=169) self.CallbackButton.configure(activebackground="#ff4545") self.CallbackButton.configure(activeforeground="white") self.CallbackButton.configure(background="#ff2424") self.CallbackButton.configure(cursor="hand1") self.CallbackButton.configure(command=QuadDrop_support.callback) self.CallbackButton.configure(text='''Emergency Callback''') self.CallbackButton.configure(state='disabled') self.colorflag = 0 self.dmodeButton = tk.Button(top) self.dmodeButton.place(relx=0.975, rely=0.952, height=28, width=29) self.dmodeButton.configure(command=QuadDrop_support.dmode) self.dmodeButton.configure(activebackground="#333333")
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.',background=_bgcolor) self.style.configure('.',foreground=_fgcolor) self.style.configure('.',font="TkDefaultFont") self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("600x350") top.minsize(120, 1) top.maxsize(1540, 845) top.resizable(0, 0) top.title("Arm Window") top.configure(background="#d9d9d9") self.TLabel1 = ttk.Label(top) self.TLabel1.place(x=0, y=10, height=40, width=600) self.TLabel1.configure(background="#d9d9d9") self.TLabel1.configure(foreground="#000000") self.TLabel1.configure(font="-family {Segoe UI} -size 18 -weight bold") self.TLabel1.configure(relief="flat") self.TLabel1.configure(anchor='center') self.TLabel1.configure(justify='center') self.TLabel1.configure(text='''Defining pHome for Manipulator''') self.TLabel2 = ttk.Label(top) self.TLabel2.place(x=442, y=70, height=39, width=105) self.TLabel2.configure(background="#d9d9d9") self.TLabel2.configure(foreground="#000000") self.TLabel2.configure(font="-family {Segoe UI} -size 13 -weight bold -slant italic") self.TLabel2.configure(relief="flat") self.TLabel2.configure(anchor='center') self.TLabel2.configure(justify='left') self.TLabel2.configure(text='''Increment:''') self.Button100 = tk.Button(top) self.Button100.place(x=455, y=110, height=34, width=77) self.Button100.configure(activebackground="#ececec") self.Button100.configure(activeforeground="#000000") self.Button100.configure(background="#25d8d3") self.Button100.configure(disabledforeground="#a3a3a3") self.Button100.configure(font="-family {Segoe UI} -size 12") self.Button100.configure(foreground="#000000") self.Button100.configure(highlightbackground="#d9d9d9") self.Button100.configure(highlightcolor="black") self.Button100.configure(pady="0") self.Button100.configure(text='''100''') self.Button1 = tk.Button(top) self.Button1.place(x=455, y=220, height=34, width=77) self.Button1.configure(activebackground="#ececec") self.Button1.configure(activeforeground="#000000") self.Button1.configure(background="#25d8d3") self.Button1.configure(disabledforeground="#a3a3a3") self.Button1.configure(font="-family {Segoe UI} -size 12") self.Button1.configure(foreground="#000000") self.Button1.configure(highlightbackground="#d9d9d9") self.Button1.configure(highlightcolor="black") self.Button1.configure(pady="0") self.Button1.configure(text='''1''') self.Button10 = tk.Button(top) self.Button10.place(x=455, y=165, height=34, width=77) self.Button10.configure(activebackground="#ececec") self.Button10.configure(activeforeground="#000000") self.Button10.configure(background="#25d8d3") self.Button10.configure(cursor="fleur") self.Button10.configure(disabledforeground="#a3a3a3") self.Button10.configure(font="-family {Segoe UI} -size 12") self.Button10.configure(foreground="#000000") self.Button10.configure(highlightbackground="#d9d9d9") self.Button10.configure(highlightcolor="black") self.Button10.configure(pady="0") self.Button10.configure(text='''10''') self.TProgressbarM0 = ttk.Progressbar(top) self.TProgressbarM0.place(x=90, y=115, width=270, height=22) self.TProgressbarM0.configure(length="270") self.TProgressbarM0.configure(maximum="1023") self.TProgressbarM0.configure(value="50.0") self.TProgressbarM0.configure(cursor="crosshair") self.TProgressbarM1 = ttk.Progressbar(top) self.TProgressbarM1.place(x=90, y=170, width=270, height=22) self.TProgressbarM1.configure(length="270") self.TProgressbarM1.configure(maximum="1023") self.TProgressbarM1.configure(value="900.0") self.TProgressbarM1.configure(cursor="crosshair") self.TProgressbarM2 = ttk.Progressbar(top) self.TProgressbarM2.place(x=90, y=225, width=270, height=22) self.TProgressbarM2.configure(length="270") self.TProgressbarM2.configure(maximum="1023") self.TProgressbarM2.configure(value="512.0") self.TProgressbarM2.configure(cursor="fleur") self.ButtonM02 = tk.Button(top) self.ButtonM02.place(x=370, y=110, height=32, width=30) self.ButtonM02.configure(activebackground="#ececec") self.ButtonM02.configure(activeforeground="#000000") self.ButtonM02.configure(background="#25d8d3") self.ButtonM02.configure(disabledforeground="#a3a3a3") self.ButtonM02.configure(font="-family {Segoe UI} -size 14 -weight bold") self.ButtonM02.configure(foreground="#000000") self.ButtonM02.configure(highlightbackground="#d9d9d9") self.ButtonM02.configure(highlightcolor="black") self.ButtonM02.configure(pady="0") self.ButtonM02.configure(text='''˃''') self.ButtonM12 = tk.Button(top) self.ButtonM12.place(x=370, y=165, height=32, width=30) self.ButtonM12.configure(activebackground="#ececec") self.ButtonM12.configure(activeforeground="#000000") self.ButtonM12.configure(background="#25d8d3") self.ButtonM12.configure(disabledforeground="#a3a3a3") self.ButtonM12.configure(font="-family {Segoe UI} -size 14 -weight bold") self.ButtonM12.configure(foreground="#000000") self.ButtonM12.configure(highlightbackground="#d9d9d9") self.ButtonM12.configure(highlightcolor="black") self.ButtonM12.configure(pady="0") self.ButtonM12.configure(text='''˃''') self.ButtonM22 = tk.Button(top) self.ButtonM22.place(x=370, y=220, height=32, width=30) self.ButtonM22.configure(activebackground="#ececec") self.ButtonM22.configure(activeforeground="#000000") self.ButtonM22.configure(background="#25d8d3") self.ButtonM22.configure(disabledforeground="#a3a3a3") self.ButtonM22.configure(font="-family {Segoe UI} -size 14 -weight bold") self.ButtonM22.configure(foreground="#000000") self.ButtonM22.configure(highlightbackground="#d9d9d9") self.ButtonM22.configure(highlightcolor="black") self.ButtonM22.configure(pady="0") self.ButtonM22.configure(text='''˃''') self.ButtonM21 = tk.Button(top) self.ButtonM21.place(x=50, y=220, height=32, width=30) self.ButtonM21.configure(activebackground="#ececec") self.ButtonM21.configure(activeforeground="#000000") self.ButtonM21.configure(background="#25d8d3") self.ButtonM21.configure(disabledforeground="#a3a3a3") self.ButtonM21.configure(font="-family {Segoe UI} -size 14 -weight bold") self.ButtonM21.configure(foreground="#000000") self.ButtonM21.configure(highlightbackground="#d9d9d9") self.ButtonM21.configure(highlightcolor="black") self.ButtonM21.configure(pady="0") self.ButtonM21.configure(text='''˂''') self.ButtonM01 = tk.Button(top) self.ButtonM01.place(x=50, y=110, height=32, width=30) self.ButtonM01.configure(activebackground="#ececec") self.ButtonM01.configure(activeforeground="#000000") self.ButtonM01.configure(background="#25d8d3") self.ButtonM01.configure(disabledforeground="#a3a3a3") self.ButtonM01.configure(font="-family {Segoe UI} -size 14 -weight bold") self.ButtonM01.configure(foreground="#000000") self.ButtonM01.configure(highlightbackground="#d9d9d9") self.ButtonM01.configure(highlightcolor="black") self.ButtonM01.configure(pady="0") self.ButtonM01.configure(text='''˂''') self.ButtonM11 = tk.Button(top) self.ButtonM11.place(x=50, y=165, height=32, width=30) self.ButtonM11.configure(activebackground="#ececec") self.ButtonM11.configure(activeforeground="#000000") self.ButtonM11.configure(background="#25d8d3") self.ButtonM11.configure(disabledforeground="#a3a3a3") self.ButtonM11.configure(font="-family {Segoe UI} -size 14 -weight bold") self.ButtonM11.configure(foreground="#000000") self.ButtonM11.configure(highlightbackground="#d9d9d9") self.ButtonM11.configure(highlightcolor="black") self.ButtonM11.configure(pady="0") self.ButtonM11.configure(text='''˂''') self.ButtonDone = tk.Button(top) self.ButtonDone.place(x=270, y=290, height=34, width=83) self.ButtonDone.configure(activebackground="#ececec") self.ButtonDone.configure(activeforeground="#000000") self.ButtonDone.configure(background="#25d8d3") self.ButtonDone.configure(disabledforeground="#a3a3a3") self.ButtonDone.configure(font="-family {Segoe UI} -size 14 -weight bold") self.ButtonDone.configure(foreground="#000000") self.ButtonDone.configure(highlightbackground="#d9d9d9") self.ButtonDone.configure(highlightcolor="black") self.ButtonDone.configure(pady="0") self.ButtonDone.configure(text='''DONE''') self.LabelM0 = tk.Label(top) self.LabelM0.place(x=90, y=99, height=16, width=272) self.LabelM0.configure(background="#d9d9d9") self.LabelM0.configure(disabledforeground="#a3a3a3") self.LabelM0.configure(font="-family {Segoe UI} -size 11") self.LabelM0.configure(foreground="#000000") self.LabelM0.configure(text='''M0: 50''') self.LabelM2 = tk.Label(top) self.LabelM2.place(x=90, y=209, height=16, width=272) self.LabelM2.configure(activebackground="#f9f9f9") self.LabelM2.configure(activeforeground="black") self.LabelM2.configure(background="#d9d9d9") self.LabelM2.configure(disabledforeground="#a3a3a3") self.LabelM2.configure(font="-family {Segoe UI} -size 11") self.LabelM2.configure(foreground="#000000") self.LabelM2.configure(highlightbackground="#d9d9d9") self.LabelM2.configure(highlightcolor="black") self.LabelM2.configure(text='''M2: 512''') self.LabelM1 = tk.Label(top) self.LabelM1.place(x=90, y=154, height=16, width=272) self.LabelM1.configure(activebackground="#f9f9f9") self.LabelM1.configure(activeforeground="black") self.LabelM1.configure(background="#d9d9d9") self.LabelM1.configure(disabledforeground="#a3a3a3") self.LabelM1.configure(font="-family {Segoe UI} -size 11") self.LabelM1.configure(foreground="#000000") self.LabelM1.configure(highlightbackground="#d9d9d9") self.LabelM1.configure(highlightcolor="black") self.LabelM1.configure(text='''M1: 900''')