# -*- coding: utf-8 -*-

import tkinter as tk

# 建立窗口window
window = tk.Tk()

# 给窗口的可视化起名字
window.title("Tello States")

ww = 500 # 窗口宽度
wh = 300 # 窗口高度
sw = window.winfo_screenwidth() # 屏幕宽度
sh = window.winfo_screenheight() # 屏幕高度

# 设定窗口的大小与位置(长x宽+x坐标+y坐标)
window.geometry(f"{ww}x{wh}+{sw//2-ww//2}+{sh//2-wh//2}")

#tk.Label(window, text="2秒ごとに更新する", fg = "red", font=("Arial",12),).place(x=10, y=10)

states = ["バッテリー残量","高度","X軸方向の速度","Y軸方向の速度","Z軸方向の速度"]

while True:

    bat = input("bat ")
    tk.Label(window, text="バッテリー残量 = "+bat, font=("Arial", 12),).place(x=10, y=30)
    h = input("h ")
    tk.Label(window, text="高度 = "+h, font=("Arial", 12),).place(x=10, y=50) 
    vx = input("vx ")
    tk.Label(window, text="X軸方向の速度 = "+vx, font=("Arial", 12),).place(x=10, y=70)
    vy = input("vy ")
    tk.Label(window, text="Y軸方向の速度 = "+vy, font=("Arial", 12),).place(x=10, y=90)
    vz = input("vz ")
    tk.Label(window, text="Z軸方向の速度 = "+vz, font=("Arial", 12),).place(x=10, y=110)

# 主窗口循环显示
window.mainloop()