Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
5001CEM/designSpecTest.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
111 lines (68 sloc)
2.23 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tkinter import * | |
from PIL import ImageTk, Image | |
def open_roadster_page(): | |
#Test page | |
roadster_page = Toplevel() | |
roadster_page.title("Design Specifications - Roadster") | |
roadster_page.geometry("1280x720") | |
#Image | |
roadster_img = ImageTk.PhotoImage(Image.open("830685.jpg")) | |
#Labels | |
roadster_title = Label(roadster_page, text="Roadsters", font="Verdana 24 bold", fg="Blue") | |
roadster_label = Label(roadster_page, image=roadster_img) | |
#Buttons | |
#Grid Arrangement | |
roadster_title.grid(row=0, column=0) | |
roadster_label.grid(row=1, column=0) | |
#Loop | |
roadster_page.mainloop() | |
def open_suv_page(): | |
#Test page | |
suv_page = Toplevel() | |
suv_page.title("Design Specifications - SUV") | |
suv_page.geometry("1280x720") | |
#Image | |
suv_img = ImageTk.PhotoImage(Image.open("suv.jpg")) | |
#Labels | |
suv_title = Label(suv_page, text="SUVs", font="Verdana 24 bold", fg="Orange") | |
suv_label = Label(suv_page, image=suv_img) | |
#Buttons | |
#Grid Arrangement | |
suv_title.grid(row=0, column=0) | |
suv_label.grid(row=1, column=0) | |
#Loop | |
suv_page.mainloop() | |
def open_hatchback_page(): | |
#Test page | |
hatchback_page = Toplevel() | |
hatchback_page.title("Design Specifications - Hatchback") | |
hatchback_page.geometry("1280x720") | |
#Image | |
hatchback_img = ImageTk.PhotoImage(Image.open("hatchback.webp")) | |
#Labels | |
hatchback_title = Label(hatchback_page, text="Hatchbacks", font="Verdana 24 bold", fg="Green") | |
hatchback_label = Label(hatchback_page, image=hatchback_img) | |
#Buttons | |
#Grid Arrangement | |
hatchback_title.grid(row=0, column=0) | |
hatchback_label.grid(row=1, column=0) | |
#Loop | |
hatchback_page.mainloop() | |
def open_sedan_page(): | |
#Test page | |
sedan_page = Toplevel() | |
sedan_page.title("Design Specifications - Sedan") | |
sedan_page.geometry("1280x720") | |
#Image | |
ogsedan_img = Image.open("sedan.jpg") | |
sedan_img= ogsedan_img.resize((850,422), Image.ANTIALIAS) | |
true_sedan_img = ImageTk.PhotoImage(sedan_img) | |
#Labels | |
sedan_title = Label(sedan_page, text="Sedans", font="Verdana 24 bold", fg="Purple") | |
sedan_label = Label(sedan_page, image=true_sedan_img) | |
#Buttons | |
#Grid Arrangement | |
sedan_title.grid(row=0, column=0) | |
sedan_label.grid(row=1, column=0) | |
#Loop | |
sedan_page.mainloop() |