# Tkinter教程之Button篇(2) ''' 5.指定Button的宽度与高度width: 宽度heigth: 高度使用三种方式:1.创建Button对象时,指定宽度与高度2.使用属性width和height来指定宽度与高度3.使用configure方法来指定宽度与高度 ''' from Tkinter import * root = Tk()b1 = Button(root,text = ' 30X1 ' ,width = 30 ,height = 2 )b1.pack()b2 = Button(root,text = ' 30X2 ' )b2[ ' width ' ] = 30 b2[ ' height ' ] = 3 b2.pack()b3 = Button(root,text = ' 30X3 ' )b3.configure(width = 30 ,height = 3 )b3.pack()root.mainloop() # 上述的三种方法同样也适合其他的控件 ''' 6.设置Button文本在控件上的显示位置anchor: