24/06/22 21:23:10.50 +hHL9oAL.net
# ダイアログを表示する
import TkEasyGUI as eg
layout = [[eg.Input(width=9, key="pt"), eg.Text("pt", width=6, height=2), eg.Button("コピー", key="pt_copy")],
[eg.Input(width=9, key="kyu"), eg.Text("級(歯)", width=6, height=2), eg.Button("コピー", key="kyu_copy")],
[eg.Input(width=9, key="mm"), eg.Text("mm", width=6, height=2), eg.Button("コピー", key="mm_copy")]]
window = eg.Window("pt-Q-mm", layout, font=(None,14), size=(250,150))
def execute():
in_pt = values["pt"]
window["kyu"].update(in_pt)
window["mm"].update(in_pt)
while True:
event, values = window.read()
if event == "pt":
execute()
if event == "kyu":
execute()
if event == "mm":
execute()
window.close()
key="pt"の入力欄に文字が入力されると、リアルタイムに、
key="kyu"とkey="mm"の入力欄にkey="pt"と同じ文字を表示したいのですが、
def execute():をどう修正すれば良いでしょうか?
今のままだと、key="pt"の入力欄に文字を入力しても、
key="kyu"とkey="mm"の入力欄に何も表示されません…