import tkinter
from tkinter import *
def go(): # 函数
print("go函数")
win = tkinter.Tk() # 构造窗体
win.title("hello zhaolin") # 标题
win.geometry("500x500+500+100") # 800宽度,800高度,x,y坐标,左上角
button = tkinter.Button(win, text="有种点我0", command=go) # 收到消息执行go函数
# button.place(height = 40,width=60, x=300,y=500-40,relx=0.5)
# button = tkinter.Button(win, text="有种点我1", command=go) # 收到消息执行go函数
# button.place(height = 40,width=60, relwidth=0.5, relheight=0.5,x=10,y=10)
# Button(win, text="位置0", command=go).place(height = 40,width=60, x=100,y=100)
Button(win, text="位置9", command=go).place(height = 40,width=60, x=100,y=100, anchor='center')
# Button(win, text="位置1", command=go).place(height = 40,width=60, x=100,y=100, anchor='n')
# Button(win, text="位置2", command=go).place(height = 40,width=60, x=100,y=100, anchor='ne')
# Button(win, text="位置3", command=go).place(height = 40,width=60, x=100,y=100, anchor='e')
# Button(win, text="位置4", command=go).place(height = 40,width=60, x=100,y=100, anchor='se')
# Button(win, text="位置5", command=go).place(height = 40,width=60, x=100,y=100, anchor='s')
# Button(win, text="位置6", command=go).place(height = 40,width=60, x=100,y=100, anchor='sw')
# Button(win, text="位置7", command=go).place(height = 40,width=60, x=100,y=100, anchor='w')
# Button(win, text="位置8", command=go).place(height = 40,width=60, x=100,y=100, anchor='nw')
# button1 = tkinter.Button(win, text="有种点", command=lambda: print("hello world"), width=20, height=10)
# button1.pack() # 加载到窗体
win.mainloop() # 进入消息循环机制
'''
in = master - 相对于其放置小部件的master
in_ = master - 请参阅'in'选项说明
x = 此小部件左上顶点的x锚点
y = 此小部件左上顶点的y锚点
relx :将此小部件的锚点定位在0.0和1.0之间,相对于主窗口的宽度(1.0是右边缘)
depend:将此小部件的锚点定位在0.0和1.0之间,相对于主窗口的高度(1.0是底边)
anchor:根据给定位置定位锚点,可以为 " n, ne, e, se, s, sw, w, nw, or center ",
例如:'center'为控件的中心点在给定位置,
's'为控件底部中心在给定位置,
'sw'为控件左下角在给定位置。
width : 此小部件的宽度(以像素为单位)
height: 此小部件的高度(以像素为单位)
relwidth : 此小部件的宽度介于0.0和1.0之间,相对于主窗口的宽度(1.0是和主窗口的宽度相同)
relheight: 此小部件的高度介于0.0和1.0之间,相对于主窗口的高度(1.0是和主窗口的高度相同)
bordermode :“inside”或“outside” - 是主窗口的边界宽度到??
'''