omnitrix-app/ben10.py

61 lines
2.1 KiB
Python
Raw 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-04-30 01:53:48 -04:00
root = Tk()
2021-04-27 03:17:12 -04:00
root.title("Omnitrix")
2021-05-01 19:11:47 -04:00
# root.attributes('-fullscreen', True)
2021-04-27 03:17:12 -04:00
root.geometry("640x480")
root.configure(bg="#70b607")
root.columnconfigure(1, weight=1)
root.rowconfigure(1, weight=1)
2021-05-01 19:11:47 -04:00
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-04-30 18:38:49 -04:00
omnitrix_button = Button(root, bg="#70b607", image=img, activebackground='#70b607',
highlightthickness=0, bd=0, command=button_press)
# TODO: make sound when pressed
omnitrix_button.image = img
2021-05-01 19:11:47 -04:00
omnitrix_button.grid(column=1, row=0, rowspan=3, columnspan=2)
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-01 19:11:47 -04:00
omnitrix_left_skip = Button(root, text="<<<", fg="white", bg="black", command=lambda: skip_down(omnitrix_button),
2021-04-30 16:35:15 -04:00
highlightthickness=0, bd=0, height=5, width=4)
omnitrix_left_skip.grid(column=0, row=0)
2021-04-30 15:29:39 -04:00
# bulk skip left button
2021-05-01 19:11:47 -04:00
omnitrix_right_skip = Button(root, text=">>>", fg="white", bg="black", command=lambda: skip_up(omnitrix_button),
2021-04-30 16:35:15 -04:00
highlightthickness=0, bd=0, height=5, width=4)
omnitrix_right_skip.grid(column=3, row=0)
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-04-30 16:35:15 -04:00
command=lambda: count_down(omnitrix_button), highlightthickness=0, bd=0, height=30, width=4)
omnitrix_left.grid(column=0, row=1, rowspan=3)
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-04-30 16:35:15 -04:00
command=lambda: count_up(omnitrix_button), highlightthickness=0, bd=0, height=30, width=4)
2021-04-30 16:35:40 -04:00
omnitrix_right.grid(column=3, row=1, rowspan=3)
2021-04-30 01:53:48 -04:00
# changes alien button (right)
2021-04-28 23:28:44 -04:00
2021-04-30 16:35:15 -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-01 19:11:47 -04:00
# change_entry = Entry(root, fg="black", bg="white",
# highlightthickness=0, bd=0, width=5)
# change_entry.grid(column=1, row=0, columnspan=2)
2021-04-30 18:38:49 -04:00
# change to specific entry
2021-04-27 03:47:11 -04:00
root.mainloop()