omnitrix-app/omnitrix.py

72 lines
2.6 KiB
Python
Raw Permalink Normal View History

2021-04-27 03:17:12 -04:00
from tkinter import *
2021-04-27 22:27:25 -04:00
from aliens import alien_table
2021-04-27 22:40:29 -04:00
from functions import *
from PIL import ImageTk, Image
2021-04-27 03:17:12 -04:00
2021-05-01 23:58:10 -04:00
start()
# start up sound effect
2021-04-30 01:53:48 -04:00
root = Tk()
2021-05-03 19:26:01 -04:00
background = StringVar()
background.set("#70b607")
# creates var and assigns it to default color
2021-04-27 03:17:12 -04:00
root.title("Omnitrix")
2021-05-05 06:04:53 -04:00
root.attributes('-fullscreen', True)
2021-04-27 03:17:12 -04:00
root.geometry("640x480")
2021-05-03 19:26:01 -04:00
root.configure(bg=background.get())
root.columnconfigure(1, weight=1)
root.rowconfigure(1, weight=1)
2021-04-30 01:53:48 -04:00
# root window parameters
2021-04-27 03:17:12 -04:00
2021-04-30 15:29:39 -04:00
2021-05-01 19:23:41 -04:00
path = "res/Omnitrix.png"
img = ImageTk.PhotoImage(Image.open(path))
2021-05-03 19:26:01 -04:00
omnitrix_button = Button(root, bg=background.get(), image=img, activebackground=background.get(),
2021-04-30 18:38:49 -04:00
highlightthickness=0, bd=0, command=button_press)
omnitrix_button.image = img
2021-05-03 19:26:01 -04:00
omnitrix_button.grid(column=1, row=0, rowspan=3, columnspan=2, sticky='senw')
2021-04-30 01:53:48 -04:00
# middle button
2021-04-27 16:08:52 -04:00
2021-04-30 16:35:15 -04:00
2021-05-03 17:30:47 -04:00
omnitrix_left_skip = Button(root, text="<<<", fg="white", bg="black", command=lambda: alien_select(-5, omnitrix_button),
2021-04-30 16:35:15 -04:00
highlightthickness=0, bd=0, height=5, width=4)
2021-05-03 19:26:01 -04:00
omnitrix_left_skip.grid(column=0, row=0, sticky='senw')
2021-04-30 15:29:39 -04:00
# bulk skip left button
2021-05-03 17:30:47 -04:00
omnitrix_right_skip = Button(root, text=">>>", fg="white", bg="black", command=lambda: alien_select(5, omnitrix_button),
2021-04-30 16:35:15 -04:00
highlightthickness=0, bd=0, height=5, width=4)
2021-05-03 19:26:01 -04:00
omnitrix_right_skip.grid(column=3, row=0, sticky='senw')
2021-04-30 15:29:39 -04:00
# bulk skip right button
2021-04-30 16:35:15 -04:00
2021-04-28 23:33:17 -04:00
omnitrix_left = Button(root, text="<", fg="white", bg="black",
2021-05-03 19:26:01 -04:00
command=lambda: alien_select(-1, omnitrix_button), highlightthickness=0, bd=0)
omnitrix_left.grid(column=0, row=1, rowspan=3, sticky='senw')
2021-04-30 01:53:48 -04:00
# changes alien button (left)
2021-04-28 23:33:17 -04:00
omnitrix_right = Button(root, text=">", fg="white", bg="black",
2021-05-03 19:26:01 -04:00
command=lambda: alien_select(1, omnitrix_button), highlightthickness=0, bd=0)
omnitrix_right.grid(column=3, row=1, rowspan=3, sticky='senw')
2021-04-30 01:53:48 -04:00
# changes alien button (right)
2021-04-28 23:28:44 -04:00
2021-04-28 23:33:17 -04:00
quit_button = Button(root, text="X", fg="white", bg="black",
2021-04-30 18:38:49 -04:00
command=root.destroy, highlightthickness=0, bd=0, width=10, height=2)
2021-04-30 16:35:15 -04:00
quit_button.grid(column=1, row=3, columnspan=2)
2021-04-30 01:53:48 -04:00
# kills program
2021-04-28 23:28:44 -04:00
2021-05-03 19:26:01 -04:00
# ? def submit_color():
# ? new_bg = background.get()
# ? print(new_bg)
# ? print(background.get()+"\n")
# ? background.set(new_bg)
# ? color_entry = Entry(root, fg="white", bg="black", highlightthickness=0, bd=0, textvariable = background)
# ? color_entry.grid(column=1, row=0, sticky='enw')
# ? color_submit = Button(root, text="+", fg="white", bg="black",
# ? highlightthickness=0, bd=0,width=10,command =lambda: submit_color())
# ? color_submit.grid(column=2, row=0, sticky='enw')
2021-04-27 03:47:11 -04:00
root.mainloop()