“列"和“列"有什么区别?和“列跨度"在 tkinter python 中? [英] What is the difference between "column" and "columnspan" in tkinter python?

查看:43
本文介绍了“列"和“列"有什么区别?和“列跨度"在 tkinter python 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 tkinter 中设置一些按钮,但我不明白 column 和 columnspan 之间有什么区别.谁能用几句话解释一下?

解决方案

Column 指定您希望小部件出现在哪一列

columnspan 告诉布局管理器您希望此小部件占据 1 列以上,即跨越 2 列

http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/grid.html https://users.tricity.wsu.edu/~bobl/cpts481/tkinter_nmt.pdf(参考文档的新链接)>

例如

widget.grid(row=0, column=1, columnspan=3)

将在第 0 行创建一个跨越第 1、2 和 3 列的小部件

I am trying to set some buttons in tkinter, and I do not understand what is the difference between column and columnspan. Can anybody explain in a few words?

解决方案

Column specifies which column you wish the widget to appear in

columnspan tells the layout manager that you wish for this widget to occupy more than 1 column i.e. spans across 2 columns

See http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/grid.html https://users.tricity.wsu.edu/~bobl/cpts481/tkinter_nmt.pdf (New link to reference document)

For example

widget.grid(row=0, column=1, columnspan=3)

Will create a widget in row 0 and that spans across columns 1, 2 and 3

这篇关于“列"和“列"有什么区别?和“列跨度"在 tkinter python 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆