80s_germany_sim and We_are_number_one added.
This commit is contained in:
parent
fbc6e4cccb
commit
e5107091fc
6 changed files with 78 additions and 3 deletions
36
Tkinter/80s_germany_sim/80s_germany_sim_main.py
Normal file
36
Tkinter/80s_germany_sim/80s_germany_sim_main.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
import tkinter as tk
|
||||
|
||||
window = tk.Tk()
|
||||
window.title('80s Germany Simulator')
|
||||
|
||||
# Labels
|
||||
top_text = tk.Label(text="0 Luftballons", font='Impact')
|
||||
top_text.pack(side=tk.TOP)
|
||||
|
||||
bottom_text = tk.Label(text='', font='Impact')
|
||||
bottom_text.pack(side=tk.BOTTOM)
|
||||
|
||||
|
||||
# Scale
|
||||
def scale_used(value):
|
||||
top_text.config(text=value + ' Luftballons')
|
||||
|
||||
|
||||
my_scale = tk.Scale(from_=0, to=99, command=scale_used, orient=tk.HORIZONTAL, width=10, length=396)
|
||||
my_scale.pack(pady=5, padx=7)
|
||||
|
||||
|
||||
# Checkbutton
|
||||
def checkbutton_used():
|
||||
print(checked_state.get())
|
||||
if checked_state.get() == 1:
|
||||
bottom_text.config(text='The Berlin wall has been torn down')
|
||||
else:
|
||||
bottom_text.config(text='The Berlin wall is still standing')
|
||||
|
||||
|
||||
checked_state = tk.IntVar()
|
||||
my_checkbutton = tk.Checkbutton(text='Is after November 9, 1989', variable=checked_state, command=checkbutton_used)
|
||||
my_checkbutton.pack(pady=2)
|
||||
|
||||
window.mainloop()
|
Loading…
Add table
Add a link
Reference in a new issue