Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- def __init__(self):
- self.root = Tk()
- self.width = 800
- self.height = 400
- self.root.geometry("{}x{}".format(self.width, self.height))
- self.root.resizable(False, False)
- self.menu_bar()
- self.tool_bar()
- self.name = Label(self.root, text="Tester", bg="black", fg="white")
- self.root.mainloop()
- def menu_bar(self):
- self.menu = Menu(self.root)
- self.root.config(menu=self.menu)
- self.subMenu = Menu(self.menu)
- self.menu.add_cascade(label="File", menu=self.subMenu)
- self.subMenu.add_command(label="New Project...")
- self.subMenu.add_command(label="Properties")
- self.subMenu.add_separator()
- self.subMenu.add_command(label="Do nothing")
- def tool_bar(self):
- self.toolbar = Frame(self.root, bg="#555555")
- self.insert_button = Button(self.toolbar, text="Insert", bg="#555555", fg="white", activeforeground="white",
- activebackground="#008CBA", borderwidth=0)
- self.insert_button.grid(row=0, column=0)
- self.print_buttom = Button(self.toolbar, text="Print", bg="#555555", fg="white", activeforeground="white",
- activebackground="#008CBA", borderwidth=0,
- command=self.root.quit)
- self.print_buttom.grid(row=0, column=1)
- self.toolbar.grid(row=0, column=0, sticky=EW)
- if __name__ == '__main__':
- App()
- class App:
- def __init__(self):
- self.root = Tk()
- ...
- self.root.columnconfigure(0,weight=1)
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement