Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 .rowconfigure是否不展开?_Python 2.7_Tkinter - Fatal编程技术网

Python 2.7 .rowconfigure是否不展开?

Python 2.7 .rowconfigure是否不展开?,python-2.7,tkinter,Python 2.7,Tkinter,我正在开发一个全屏程序,.columnconfigure可以工作,但是.row configure不能工作 from Tkinter import * root = Tk() w, h = root.winfo_screenwidth(), root.winfo_screenheight() root.overrideredirect(1) root.geometry("%dx%d+0+0" % (w, h)) root.bind("<Escape>",quit) root.conf

我正在开发一个全屏程序,.columnconfigure可以工作,但是.row configure不能工作

from Tkinter import *
root = Tk()
w, h = root.winfo_screenwidth(), root.winfo_screenheight()
root.overrideredirect(1)
root.geometry("%dx%d+0+0" % (w, h))
root.bind("<Escape>",quit)
root.config(bg="black")
root.columnconfigure(1,weight=1)
root.columnconfigure(2,weight=1)
root.columnconfigure(3,weight=1)
root.columnconfigure(4,weight=1)
root.rowconfigure(1,weight=1)
root.rowconfigure(2,weight=1)
root.rowconfigure(3,weight=1)
root.rowconfigure(4,weight=1)
Label(text="hey").grid(row=0, column=1,sticky="WENS")
Label(text="hey").grid(row=0, column=2,sticky="WENS")
Label(text="hey").grid(row=0, column=3,sticky="WENS")
Label(text="hey").grid(row=0, column=4,sticky="WENS")
root.mainloop()
从Tkinter导入*
root=Tk()
w、 h=root.winfo_屏幕宽度(),root.winfo_屏幕高度()
root.overrideredirect(1)
根几何体(“%dx%d+0+0”%(w,h))
root.bind(“,退出)
root.config(bg=“black”)
root.columnconfigure(1,权重=1)
root.columnconfigure(2,权重=1)
root.columnconfigure(3,权重=1)
root.columnconfigure(4,权重=1)
rowconfigure(1,权重=1)
rowconfigure(2,权重=1)
rowconfigure(3,权重=1)
rowconfigure(4,权重=1)
标签(text=“hey”).grid(行=0,列=1,sticky=“WENS”)
Label(text=“hey”).grid(行=0,列=2,sticky=“WENS”)
Label(text=“hey”).grid(行=0,列=3,sticky=“WENS”)
Label(text=“hey”).grid(行=0,列=4,sticky=“WENS”)
root.mainloop()

您总是在第0行添加标签。但您需要配置第1到第4行。绝不是0

这可能就是rowconfigure似乎不起作用的原因