问题描述
columnconfigure
、grid_columnconfigure
、grid.columnconfigure
和 grid columnconfigure
之间有什么区别吗?>tkinter?我有点困惑,因为这个包似乎有不同版本或不同的文档,例如这个 似乎是某种命令行/shell 语言,没有与 Python 的关系.
Are there any differences between columnconfigure
, grid_columnconfigure
, grid.columnconfigure
, and grid columnconfigure
in tkinter
? I'm getting a little confused as there seems to be either different versions of this package or different documentations floating around, e.g. this one that appears to be some command line/shell language with no relation to Python.
推荐答案
来自 tkinter
的源代码(Python 3.9 it's line 1776):
From tkinter
's source code (Python 3.9 it's line 1776):
class Misc:
...
def grid_columnconfigure(self, index, cnf={}, **kw):
"""Configure column INDEX of a grid.
Valid resources are minsize (minimum size of the column),
weight (how much does additional space propagate to this column)
and pad (how much space to let additionally)."""
return self._grid_configure('columnconfigure', index, cnf, kw)
columnconfigure = grid_columnconfigure
然后在第 2499 行:
then on line 2499:
class Grid:
...
columnconfigure = grid_columnconfigure = Misc.grid_columnconfigure
这表明它们是完全相同的功能
It shows you that they are the same exact functions
grid columnconfigure
实际上不是 tkinter
而是 tcl
.这是 tkinter
在内部使用的.你真的不需要知道.
The grid columnconfigure
is actually not tkinter
but tcl
. It's what tkinter
uses internally. You don't really need to know it.
这篇关于tkinter 的 columnconfigure 方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!