做了一个,哈哈,献丑了:
源码如下:
- import tkinter as tk
- from tkinter import messagebox
- win = tk.Tk()
- def james():
- messagebox.showinfo('提示','你好james007')
- def simon():
- messagebox.showinfo('提示','站长,你好!')
- def legs():
- messagebox.showinfo('提示','你好legs+')
- win.title('美丽心灵论坛')
- win.geometry('400x300')
- btn1=tk.Button(win,text='我是james',command=james).grid(column=0,row=0)
- btn2=tk.Button(win,text='我是simonzhd',command=simon).grid(column=1,row=0)
- btn3=tk.Button(win,text='我是legs+',command=legs).grid(column=2,row=0)
- win.mainloop()
复制代码 |