import tkinter as tk
from tkinter import messagebox

# ハンドラ関数
def clicked():
  messagebox.showinfo('メッセージ', 'こんにちは！')

root = tk.Tk()
root.title('イベントドリブン')
root.geometry('250x120')

# Buttonウィジェットの生成と配置
button_1 = tk.Button(
  root,
  text='ボタン1',
  command=clicked)
button_1.pack(expand=True)

root.mainloop()
